I’m pretty sure this is a bug and i already wrote this to @twitterdev but was told to post it here.
When you want to upload an image to the media/upload endpoint (to use it for extended entities) the documentation states that you can encode the image in base-64 but then have to use the param “media_data” instead of “media”.
But if you do as said, the API returns an error: "media param has zero bytes."
Since the media param should have zero bytes when uploading base-64 images (if i understand the documentation correctly) this seems to be a bug.
I tested this in my app and via twurl:
twurl -H upload.twitter.com "/1.1/media/upload.json" -d "type=photo" -f ~/my/image.png -b -F "media_data" -X POST
I hope you can fix this or tell me what i’m doing wrong ^^