Here's what the HTTP POST for Twitter looks like using update_with_media.xml .
Your application should set the authorization header in a way that is specific to your application, given the token, the secret of the tokens, etc.
Platform-specific libraries exist that help generate the value of the authorization header. For example, in .NET there is an open source OAuth.Manager class for this.
POST https://upload.twitter.com/1/statuses/update_with_media.xml HTTP/1.1 Authorization: OAuth oauth_callback="oob", oauth_consumer_key="FXJ0DIH50S7ZpXD5HXlalQ", oauth_nonce="7774328k", oauth_signature="pUYjRnccmrBYiO1j9cliETsw%2B5s%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1318300521", oauth_token="59152613-vrlZ2edX56PudQtBmpAWd3SPDt9cPyAhibO7ysl6W", oauth_version="1.0" Content-Type: multipart/form-data; boundary=======c49479438c600bf59345e====== Host: upload.twitter.com Content-Length: 7320 Connection: Keep-Alive --======c49479438c600bf59345e====== Content-Disposition: form-data; name="status" working on a Tweet tool that uses the OAuth Manager library. --======c49479438c600bf59345e====== Content-Disposition: file; name="media[]"; filename="ThisIsAPicture.png" Content-Type: image/png ...binary png data here... --======c49479438c600bf59345e======-- , oauth_consumer_key = "FXJ0DIH50S7ZpXD5HXlalQ", oauth_nonce = "7774328k", oauth_signature = "pUYjRnccmrBYiO1j9cliETsw% 2B5s% 3D", oauth_signature_method = "HMAC-SHA1", oauth_timestamp = " POST https://upload.twitter.com/1/statuses/update_with_media.xml HTTP/1.1 Authorization: OAuth oauth_callback="oob", oauth_consumer_key="FXJ0DIH50S7ZpXD5HXlalQ", oauth_nonce="7774328k", oauth_signature="pUYjRnccmrBYiO1j9cliETsw%2B5s%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1318300521", oauth_token="59152613-vrlZ2edX56PudQtBmpAWd3SPDt9cPyAhibO7ysl6W", oauth_version="1.0" Content-Type: multipart/form-data; boundary=======c49479438c600bf59345e====== Host: upload.twitter.com Content-Length: 7320 Connection: Keep-Alive --======c49479438c600bf59345e====== Content-Disposition: form-data; name="status" working on a Tweet tool that uses the OAuth Manager library. --======c49479438c600bf59345e====== Content-Disposition: file; name="media[]"; filename="ThisIsAPicture.png" Content-Type: image/png ...binary png data here... --======c49479438c600bf59345e======--
Cheeso
source share