Save the date! Join us on October 16 for our Product Ops launch event. Register here.
May 04, 2017 04:02 AM
As far as I can tell I aways get nice JSON responses, but with this error the response comes in the form of a HTML page. My error handling didn’t like that.
<!DOCTYPE html>
<html>
<head>
etc
<h1 class="my2">This page is taking too long to load.</h1>
Is this intentional?
May 04, 2017 10:10 AM
Hi Tuur,
No, it shouldn’t be like that. What client language/library are you using? Do you have the headers that you are sending? What’s in the content-type and accept headers?
Alex
May 04, 2017 11:37 AM
The hard part is that it almost never happens of course, so it’s difficult to reproduce.
I’ll be back when I have more…
May 04, 2017 01:19 PM
What are those headers for regular requests?
Alex
May 04, 2017 11:52 PM
Generally Authorization & Content-Type (application/json) for Post / Patch (HTTP 1.1).
The reason I was asking is that I have a feeling it is related to attachments / photos fields and server-side time-outs only. So I was figuring it might have been some sort of internal error forwarding that’s not converted or something.
But the problem might just as well be me too of course. :slightly_smiling_face:
May 05, 2017 12:12 AM
Anyway, I’ve added the Accept (application/json) now too. I’ll be back…
May 05, 2017 01:04 AM
So rethinking about this all; you probably take my content type header for post & patch as the default for your response and since that hint is missing for the other requests (specifically ‘get’) I get HTML?
May 05, 2017 09:34 AM
Yeah, that’s probably it. We only look at content-type and if it’s not set, you’d get HTML. GET requests may or may not include content-type as it should be sending no content. There was a recent patch for that to airtable.js.
I think we’ll need to change it to just never return HTML for api.airtable.com. Our API always returns JSON anyway.
May 05, 2017 09:46 AM
I was lazily assuming that. And never noticed until I got timed out (which almost never happens).
Anyway, learned a couple of new things. Thanks for the help!
May 25, 2017 01:38 AM
After adding the Accept header (to application/json) I’m still getting HTML with 504’s & 502’s. The weird thing is that sometimes the 502’s come in JSON. I’ve already double checked my code, but I’m pretty sure my calls are consistent.
Since these are both time-out errors could it be something in the processing (order?) on your side or can I try other headers / combinations?
<h1 class="my2">This page is taking too long to load.</h1>
<h3 class="quiet">Sorry about that. Please try refreshing and contact us if the problem persists.</h3>