Hi!
I am trying to post a pdf file using cURL, but I'm struggling to do so.
The API documentation of the receiving party says:
Finally, send an HTTP POST request to the
uploadUrl
without aContent-Type
header. You can use this cURL command to try the upload URL. Supported formats are.png
, and.jpg
.
curl --location --request POST '$YOUR_URL' \
--form 'Key="INPUT/$YOUR_ID"' \
*[several other --form]*
--form 'file=@"$YOUR_FILE_PATH"'
When you upload a document with the HTTP POST cURL command, Amazon sends a 204: No content error, but the document was successfully uploaded .
So I created a REST query in my app that is like follows:
I do get the 204: No content as a response, however the file is never uploaded to the third party.
I tried several things:
- format of the file line with and without '@', with and without quotes,
- switching to a raw body in the Retool query
- switching to a x-www-form-urlencoded body in the Retool query
It did not seem to change anything (same response, file not uploaded).
Has anyone ever succeeded in uploading a file using cURL on Retool?
Am I doing anything wrong with the format of the query, especially the 'file' line?
Thank you so much for your help!