Hi,
I m trying to upload media to twitter upload endpoint and I m always getting over capacity error. With the same oauth parameters I am able to tweet messages successfully. The code is below. any help will be greatly appreciated.
formData = "--boundary\r\n";
formData += 'Content-Disposition: form-data; name="media_data"; filename="test.jpg"\r\n';
formData += 'Content-Type: image/jpeg\r\n';
formData += 'Content-Transfer-Encoding: base64\r\n\r\n';
formData += blobBase64;
formData += "\r\n" + "--boundary\r\n";
xhr.setRequestHeader("Content-Type", 'multipart/form-data; boundary="--boundary"');
xhr.setRequestHeader('Authorization','OAuth oauth_consumer_key="consumerkey", oauth_nonce="nonce", oauth_signature="signature", oauth_signature_method="signaturemethod", oauth_timestamp="timestamp", oauth_token="token", oauth_version="version"');
xhr.send(formData);
The url is https://upload.twitter.com/1.1/media/upload.json