Thanks Alex.  I used curl to see what the request should look like and
then coded up my request accordingly.  It's working for me now.

On Dec 6, 11:37 am, "Alex Payne" <[EMAIL PROTECTED]> wrote:
> The test we use for this method is to use curl:
>
> curl -F '[EMAIL PROTECTED]/to/test/image.jpg' -u 
> USERNAME:PASSWORDhttp://twitter.com/account/update_profile_image.xml
>
> If you use an HTTP proxy, you can see it generating the appropriate
> request and response.
>
>
>
> On Sat, Dec 6, 2008 at 00:09, Lien Tran <[EMAIL PROTECTED]> wrote:
>
> > Hello,
>
> > I've been trying to update myprofileimageusing the account method
> > update_profile_image.  However, the server keeps returning the error
> > "There was a problem with your picture. Probably too big."  The photo
> > I am trying to upload is a jpg less than 700 kilobytes in size.  Below
> > is the request body and request response.
>
> > Request body:
> > POST /account/update_profile_image.xml HTTP/1.1
> > Authorization: Basic <encoded credentials here>
> > User-Agent: Jakarta Commons-HttpClient/3.1
> > Host: twitter.com
> > Content-Length: 71440
> > Content-Type: multipart/form-data; boundary=tUGDGHg6-
> > mbUEjVXYFhFWeb_NFmBUxiXOK
>
> > --tUGDGHg6-mbUEjVXYFhFWeb_NFmBUxiXOK
> > Content-Disposition: form-data; name="Sunset.jpg";
> > filename="Sunset.jpg"
> > Content-Type: application/octet-stream; charset=ISO-8859-1
> > Content-Transfer-Encoding: binary
>
> > <binary data here>
>
> > --tUGDGHg6-mbUEjVXYFhFWeb_NFmBUxiXOK--
>
> > Response body:
> > HTTP/1.1 403 Forbidden
> > Date: Sat, 06 Dec 2008 07:59:53 GMT
> > Server: hi
> > Last-Modified: Sat, 06 Dec 2008 07:59:53 GMT
> > Status: 403 Forbidden
> > Pragma: no-cache
> > Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, post-
> > check=0
> > Content-Type: application/xml; charset=utf-8
> > Content-Length: 183
> > Expires: Tue, 31 Mar 1981 05:00:00 GMT
> > Set-Cookie:
> > _twitter_sess=BAh7BzoHaWQiJWRhOWNmNjI1MGM5MjRmYWIwOGEzOGQwNTQyYzNmZTNjIgpm
> > %250AbGFzaElDOidBY3Rpb25Db250cm9sbGVyOjpGbGFzaDo6Rmxhc2hIYXNoewAG
> > %250AOgpAdXNlZHsA--d9fe4dcadf2064553d3371c9fe767ff009f20c21;
> > domain=.twitter.com; path=/
> > Vary: Accept-Encoding
> > Connection: close
>
> > <?xml version="1.0" encoding="UTF-8"?>
> > <hash>
> >  <request>/account/update_profile_image.xml</request>
> >  <error>There was a problem with your picture. Probably too big.</
> > error>
> > </hash>
>
> > Does the request body look correct?  Does anyone have a sample of what
> > the request body should look like if this is not correct?
>
> > Thanks.
>
> --
> Alex Payne - API Lead, Twitter, Inc.http://twitter.com/al3x

Reply via email to