Last active
January 1, 2016 23:09
-
-
Save GOROman/8214880 to your computer and use it in GitHub Desktop.
環境: Windows7 64bit twurlでTwitterに画像を添付したいだけなのに ”403 Forbidden” でどうにも出来ないのでキレそう。。。 ⇒ 解決
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Cygwinにしたら解決しました・・・ | |
$ ruby -v | |
ruby 1.9.3p448 (2013-06-27) [x86_64-cygwin] | |
$ twurl -v | |
0.9.1 | |
$ twurl -d 'status=HELLO KARAAGE!' -X POST "/1.1/statuses/update_with_media.json" --file "TEST.png" --file-field "media[]" -t | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
パケットの中身
POST /1.1/statuses/update_with_media.json HTTP/1.1
Accept: /
User-Agent: OAuth gem v0.4.7
Content-Type: multipart/form-data, boundary="00Twurl315658315140108384lruwT99"
Authorization: OAuth oauth_body_hash="...",oauth_consumer_key="...", oauth_nonce="...", oauth_signature="...", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1388637706", oauth_token="...", oauth_version="1.0"
Connection: close
Host: api.twitter.com
Content-Length: 535
--00Twurl315658315140108384lruwT99
Content-Disposition: form-data; name="status"
HELLO KARAAGE!
--00Twurl315658315140108384lruwT99
Content-Disposition: form-data; name="media[]"; filename="TEST.png"
Content-Type: application/octet-stream
Content-Transfer-Encoding: base64
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAAXNSR0IArs4c\n6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAwSURB\nVDhPlcexDQAwCMAw/j+XB8ruJarkxfP2j08++eSTTz755JNPPvnkk08++bBz\nNrbxENvBoHQAAAAASUVORK5CYII=
--00Twurl315658315140108384lruwT99--