I am given the following commands for curl from the documentation for an API but for Laserfiche we need HTTP so I asked ChatGPT to convert it and I am not having any luck because the response is thinking that the media_type is text/plain instead of image/png and the resulting uploaded file gets corrupted.
curl --location -g --request POST 'https://api.freshbooks.com/uploads/account/<accountId>/attachments' \ --header 'Authorization: Bearer ' \ --form 'content=@"/path/to/file"'
Here is my conversion from ChatGPT for a POST method with multipart/form-data content type and Yaegaki boundary
--Yaegaki Content-Disposition: form-data; name="content"; filename="%(Name: entryName; Type: Text).png" Content-Type: image/png %(Name: File; Type: File) --Yaegaki--
Based on the documentation the response should return
"media_type": "image/png",
Instead it says
"media_type": "text/plain",
It accepts the file but as the wrong format and all the png information gets corrupted. The problem must be in my conversion from curl commands to HTTP. I tried with binary encoding but there is not binary command in the curl command and the server rejects it.