cURL REST API to Livecode decyphering
Posted: Mon Oct 27, 2014 5:46 pm
I want to see if there is a known formula for creating cURL commands with Livecode based on the standard documentation of a REST API for Livecode.
So far I know this:
Livecode can POST, PUT, GET
POST can carry an object string of data along with it.
API syntax is usually something like
So what would Livecode do???
-Will
So far I know this:
Livecode can POST, PUT, GET
POST can carry an object string of data along with it.
API syntax is usually something like
orcurl https://api.sandbox.paypal.com/v1/oauth2/token \
-H "Accept: application/json" \
-H "Accept-Language: en_US" \
-u "<Client-Id>:<Secret>" \
-d "grant_type=client_credentials"
So what is one to do with the -u, -h, -d lines? I know that everything has to be withing 2 strings maximum. I have been searching through a lot of documentation and from the looks of it, other languages accept the format above and then automatically translate it into a proper cURL before transmitting. However Livecode does not.curl "https://my.ecwid.com/api/oauth/token" \
-XPOST \
-d client_id=abcd0123 \
-d client_secret=01234567890abcdefg \
-d code=987654321hgfdsa \
-d redirect_uri=https://www.example.com/myapp
-d grant_type=authorization_code
So what would Livecode do???
-Will