Hi
I am trying to convert a cURL command to AppleScript Using “do shell script”.
I’ve used various hints from previous posts but I’m still running into errors.
Can anyone point out errors in my syntax.
The below script works fine when run in terminal.
I then adapt as.
--Add do shell script Command--
--Place The cURL Inside Double Quotes--
--Replace Double Quotes With Single Quotes--
--Remove Backslashes At End Of Lines--
--You May Also Need To Place All In A Single Line--
do shell script "curl -X POST https://content.dropboxapi.com/2/files/upload --header 'Authorization: Bearer MYTOKEN' --header 'Content-Type: application/octet-stream' --header 'Dropbox-API-Arg: {'path':'/RoomVT/Clown2.jpeg'}' --data-binary @'/Splash.jpeg'"
I still get the error.
“Error in call to API function "files/upload": HTTP header "Dropbox-API-Arg": could not decode input as JSON”
The Piyocast website was where I learned how to make calls
Via a NSURLSession. Here’s a link to tagged articles. Just use a
Translator to view site in English.