Skip to content

Commit

Permalink
fix update_with_media
Browse files Browse the repository at this point in the history
* send multipart/form-data header
* send requests to upload.twitter.com
  • Loading branch information
stve committed Feb 1, 2014
1 parent 88d7b19 commit a902914
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/twitter/rest/tweets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ def update_with_media(status, media, options = {})
hash = options.dup
hash[:in_reply_to_status_id] = hash.delete(:in_reply_to_status).id unless hash[:in_reply_to_status].nil?
hash[:place_id] = hash.delete(:place).woeid unless hash[:place].nil?
hash[:headers] = {'Content-Type' => 'multipart/form-data', 'Host' => 'upload.twitter.com'}
perform_with_object(:post, '/1.1/statuses/update_with_media.json', hash.merge('media[]' => media, 'status' => status), Twitter::Tweet)
end

Expand Down

0 comments on commit a902914

Please sign in to comment.