>From looking at the archives of this group, uploading images to
Twitter seems to be a common source of problems. I've found a couple
of posts describing the exact same problem I have, but without
resolution. (e.g.
for example). So here is another attempt, with a dump of the wire
traffic in case anyone can spot the problem.

My request:


POST /1/account/update_profile_image.xml HTTP/1.1
Accept-Encoding: identity
Content-Length: 118492
Host: api.twitter.com:80
User-Agent: Python-urllib/2.6
Connection: close
Content-Type: multipart/form-data;
Authorization: Basic (...)

Content-Disposition: form-data; name="image"; filename="test.jpg"
Content-Type: image/jpeg
Content-Length: 118295

<file content>


The response I get:


HTTP/1.1 500 Internal Server Error
Date: Thu, 25 Mar 2010 06:11:51 GMT
Server: hi
Status: 500 Internal Server Error
Content-Type: text/html; charset=UTF-8
Cache-Control: max-age=300
Expires: Thu, 25 Mar 2010 06:16:51 GMT
Vary: Accept-Encoding
Connection: close
Transfer-Encoding: chunked

Status: 500 Internal Server Error
Content-Type: text/html

<html><body><h1>500 Internal Server Error</h1></body></html>Status:
500 Internal Server Error
Content-Type: text/html

<html><body><h1>500 Internal Server Error</h1></body></html>


It's not a copy/paste error, the body (and a couple of HTTP headers)
appear twice. Go figure.

I can't see the pb w/ the headers and how the response is structured.

My guess is that there might be something about the images themselves
and the way they're encoded. But I've tried several of them (JPG, PNG
and GIF) with the same result. They are all reasonably sized and work
just fine it I upload them directly via the Web interface.

As you can tell from the user agent in the dump above, my code is in
Python 2.6, with the help of the Poster (http://pypi.python.org/pypi/
poster/0.5) library to do the multi-part stuff. But I am not asking
for Python assistance, more on-the-wire compatibility assistance.

To unsubscribe from this group, send email to 
twitter-development-talk+unsubscribegooglegroups.com or reply to this email 
with the words "REMOVE ME" as the subject.

Reply via email to