This blog is NOFOLLOW Free!

twitter-bird-2I’ve been playing with the Twitter  API again (authenticated REST requests this time), and kept getting this nasty 417 Expectation Failed HTTP error.

I checked the sent headers, there was no Expect header being sent, until I realised the requests I was making to twitter using POST HTTP method weren’t sending the variables I wanted to POST, or they were incorrectly formatted.

So, if you’re ever playing with Twitter’s API, make sure that when POSTing data, variables follow. This ate 30 minutes of my life.

Now, this happens only for requests where POSTed data is expected.  I guess the response Twitter sends is a general one, usually, the 417 HTTP Error shows up only when there’s an Expect header present.

I haven’t read the RFC specs for what can happen when no data is POSTed, but I guess a less ambiguous message than this, could be taken into account.

, , ,

If you’re getting an error like “403 Service Over Qps” or “ERR_403_SERVICE_OVER_QPS“, you’re probably playing with an API provided by the Mashery.com webservice.

Some of the sites serving their API content via Mashery are The Guardian, and compete.com. The trouble I have comes with compete.com, however, I’ve seen people dealing with theguardian.co.uk as well.

The reason why you are seeing this is probably because you are sending over too many requests in so little amount of time.  To prevent this from happening, you should check the API’s service limits, and also test it against the real possible limits, e.g. if they say 5 requests max per second, try 4 requests per seconds, the limit may be lower than documented.

This error also comes with a HTTP response code of 403, Forbidden.

, , , , ,