Banging my head against the wall trying to figure out why this isn’t working for me. I tried twurl so that I could see an example of the format of the web request for the /1.1/media/upload.json API call.
Here is what I believe is the relevant part of my request body (I removed the image bytes for easier reading):
–b9cdcccbc77b1e552aa5f51f216bfb7bc2baea51362184553199b1cab033
Content-Disposition: form-data; name=“media”; filename="image.jpg"
Content-Type: application/octet-stream
…
…
–b9cdcccbc77b1e552aa5f51f216bfb7bc2baea51362184553199b1cab033–
In the request header, I set the content type to multipart/form-data and initialized the boundary value to the one above.
In twurl the request body looks almost identical to mine, but whereas the twurl request was successful, I am repeatly getting a 38 error code.
Is there some other logical reason why the Twitter API wouldn’t be recognizing the media parameter in my request, even though it’s there? I’m thinking the code could be a red herring for something else.
Please help Twitter Gods! I’m at my wit’s end.