Latest Tweets

 

Twitter API, what do you Expect?

I’ve bowed to the inevitable and now have a twitter account. Being on the geeky end of the human spectrum, the first thing I wanted to do was write a some Java code that will push new profile images.

I’m running along nicely, and the first problem I hit comes as I finish my coding and start testing. Twitter responds with:

The expectation given in the Expect request-header field could not be met by this server. The client sent Expect: 100-Continue but we only allow the 100-continue expectation

That such a widely used service can’t stick to one of the plainest elements of the HTTP 1.1 specification is depressing.

Comparison of expectation values is case-insensitive for unquoted tokens (including the 100-continue token), and is case-sensitive for quoted-string expectation-extensions.

But what is worse is that the Apache HTTP library I’m using doesn’t allow this header to be amended in any way — it gets magically added at the point at which the request is made so there’s no opportunity to remove it — and something as simple as this multipart image upload becomes a trial…

  1. tomgibara posted this
blog comments powered by Disqus