Iâm trying to send a POST Request with nodejs but my request fails. Does anybody have a hint?
Tried the following:
Content-Type: multipart/form-data; boundary=---------------------------48870936082676053
-----------------------------48870936082676053
Content-Disposition: form-data; name=âmediaâ; filename="image_5.jpg"
Content-Type: application/octet-stream
Content-Transfer-Encoding: base64
base64 encoded image content
-----------------------------48870936082676053â
But the API responds with âUnknown Twitter API Errorâ (Status Code 400) ânot recognized.â
When using media_data parameter as described in the article (cite: âNote that if youâre uploading a base64-encoded, the param name for this endpoint will be media_data rather than media, which is used for raw images.â)
Content-Type: multipart/form-data; boundary=---------------------------5757786715403199
-----------------------------5757786715403199
Content-Disposition: form-data; name=âmedia_dataâ; filename="image_5.jpg"
Content-Type: application/octet-stream
Content-Transfer-Encoding: base64
base64 encoded image
-----------------------------5757786715403199â
The API responds with âUnknown Twitter API Errorâ (Status Code 409) âmedia param has zero bytesâ