Still trying to post images to Twitter using OAuth unsuccessfully.  Can
someone please help?

My latest attempt is inline with what I can gather from other people who
claim to do it successfully: put ALL parameters in the multipart entity and
have a very simple OAuth signature base string:.

The signature was constructed based on this signature base string:


And here is the raw text I sent:

POST /account/update_profile_image.xml HTTP/1.1
Content-Type: multipart/form-data;
User-Agent: DotNetOpenAuth/
Cache-Control: no-store,no-cache
Pragma: no-cache
Content-Length: 20134

Content-Disposition: form-data; name="oauth_token"

Content-Disposition: form-data; name="oauth_consumer_key"

Content-Disposition: form-data; name="oauth_nonce"

Content-Disposition: form-data; name="oauth_signature_method"

Content-Disposition: form-data; name="oauth_signature"

Content-Disposition: form-data; name="oauth_version"

Content-Disposition: form-data; name="oauth_timestamp"

Content-Disposition: form-data; name="image"; filename="thomas
Content-Type: image/jpg
Content-Transfer-Encoding: binary

<beginning of raw binary data>

Andrew Arnott
"I [may] not agree with what you have to say, but I'll defend to the death
your right to say it." - S. G. Tallentyre

On Sat, Jan 9, 2010 at 4:59 PM, Andrew Arnott <>wrote:

> Can anyone from Twitter, or someone who's successfully done it with a
> consumer library, please lay out the exact format of the HTTP request
> Twitter expects for an OAuth-signed image upload?  By my reading the OAuth
> spec allows several possibilities, assuming multi-part POST:
>    1. Only the the image (and tile) parameters are in the POST entity.
>     All the OAuth-specific parameters are in the HTTP Authorization header,
>    thereby allowing them to be signed.
>    2. All the parameters, OAuth ones and image ones, are in the POST
>    entity, leaving nothing by the HTTP method and URL to be signed using the
>    OAuth signature.
>    3. The OAuth specific parameters appear in the query string of the POST
>    url, and once again the image parameter appears in the POST entity.
> Which of these does Twitter support?  I'm trying #1 without any success.
>  Before investing in upgrading my library to support each of these
> scenarios, I'd like to know which one will end up successful.  Right now I'm
> getting Status 500 errors.
> Thanks.

Reply via email to