Tweet a photo error with multipart/form-data


#1

I’m trying to tweet a photo using the Twitter API
I’m using https://oauth.io/docs to successfully authenticate and post regular text statuses. However, I get an Access-Control-Allow-Origin error (in browser console) when attempting to tweet a photo using update_with_media.

XMLHttpRequest cannot load https://oauth.io/request/twitter/%2F1.1%2Fstatuses%2Fupdate_with_media.json. No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://doubletaketech.net’ is therefore not allowed access.

How do I overcome what looks like a CORS error to me?

Please advise.
Thank you,
Don

Details below:
I am setting contentType to multipart/form-data like the Twitter docs say.

I’m formatting the photo as a base64 dataUrl string.

oauthResult.post({
url: '/1.1/statuses/update_with_media.json',
data: {status: status,media: dataURL},
contentType: 'multipart/form-data'
}).done(function(res) {
      console.log(res); 
 });
 });

These are the headers I see in Chrome’s console

Request URL:https://oauth.io/request/twitter/%2F1.1%2Fstatuses%2Fupdate_with_media.json
Request Headers CAUTION: Provisional headers are shown.
Accept:*/*
Content-Type:multipart/form-data
oauthio:k=UVFc6b1_flhDa82kOypOR2FXYxc&oauthv=1&oauth_token=2345274750-fLT28qhn5NJdhUoN84zOs3VtzSEIJy9Yywv5GWu&oauth_token_secret=hft2npKoyWoUe3r1v4jPFdjBbXMB4mGKchN44gcFK0On1
Origin:http://doubletaketech.net
Referer:http://doubletaketech.net/ut/
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36
Request Payload
status=Testing+post&media=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAKAAAAB4CAYAAAB1ovlvAAAgAElEQVR4Xky955OsaXrm9WRVVmaWN8e77j7t7XRPd8%2F0THs33WOl2NWuEIog2F0CsRtBwBc%2BEAT8A%2FAJRQARiz6wAQEsYkMCFCBpVjvSaKTR%2BJm2p%2Ft47095k.......