Looking for any example of REST API calls and handling responses via sense-talk. Is there any help doc or sample that I can check? Appreciate it.
Hey @scsvel,
here are the docs references for Sensetalk API commands.
You might be surprised how simple some of them are.
-
Post data to URL
post queryData to url "http://someservice.net" with headers {"Content-Type": "text/xml"}
or put -
Post Multipart | files
post multipart {filename:"/tmp/xyz", body:file "/tmp/xyz" as data} to URL serverURL
-
POST MIME
put (multipartMIME("Secret Message" as data) adding {request:"/"}) as http
-
Results are stored in the variable
it
meansput it -- will print the result of the request before
get url "https://api.postcodes.io/random/postcodes"
put it
put url "https://api.postcodes.io/random/postcodes"
Hope this is what you aimed for.
Cheers,
Karsten
1 Like
Thanks @Karsten . Exactly I am looking for.
1 Like