Send an http request with the possibility to evaluate the answer

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Gille
Posts: 17
Joined: Fri Jan 19, 2018 8:52 pm

Send an http request with the possibility to evaluate the answer

Post by Gille »

hi nerds :D
How can I send http requests with Livecode and evaluate the response from the web server?
I use the community version ...

many Greetings
Gille
:shock:
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10501
Joined: Wed May 06, 2009 2:28 pm

Re: Send an http request with the possibility to evaluate the answer

Post by dunbarx »

Hi,

Not sure what you are asking, but right now go to the dictionary, and look for "URL". Now filter out everything but commands. Do any of those, especially "Launch URL or "revGoURL", help?

Also check out the "related" items in the entry.

And maybe you might like the "get URL" variant of the "get" command.

Craig Newman
Gille
Posts: 17
Joined: Fri Jan 19, 2018 8:52 pm

Re: Send an http request with the possibility to evaluate the answer

Post by Gille »

hello Craig,
Thanks for your quick reply.

Please look here:
https://www.auerswald.de/de/service/125 ... pi-de.html

I would like to send http-Request with the app and evaluate the answer.

many Greetings
Gille
:shock:
mrcoollion
Posts: 744
Joined: Thu Sep 11, 2014 1:49 pm

Re: Send an http request with the possibility to evaluate the answer

Post by mrcoollion »

Take a look at tsNet External.
http://lessons.livecode.com/m/4071/l/85 ... t-external
http://lessons.livecode.com/m/4071/l/84 ... chronously

In Dictionary search for tsNet to see all options.
https://milby.us/lc/docs/api.html?
Not everything works in community edition..
https://livecode.com/products/livecode- ... ing-layer/

Regards,

Paul
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Send an http request with the possibility to evaluate the answer

Post by Klaus »

Hi gille,

what Craig said about -> get url"xyz"

To use the first example from the API:

Code: Select all

...
put url("https://192.168.0.240/app_about") into tServerAntwort
## Check for errors here, I'll leave that to you :-)

## The server returns a JSON array, and LC can convert this to a LC array:
put JSONtoArray(tServerAntwort) into tLCArray

## Now you can parse that array LCArray...
...
Best

Klaus
Gille
Posts: 17
Joined: Fri Jan 19, 2018 8:52 pm

Re: Send an http request with the possibility to evaluate the answer

Post by Gille »

cool!
And thank you !!!
I'll try it right away!
:shock:
Gille
Posts: 17
Joined: Fri Jan 19, 2018 8:52 pm

Re: Send an http request with the possibility to evaluate the answer

Post by Gille »

Hello Klaus,
can we meet in the German-speaking forum?
I do not really get along. :(

Can you trace the query?
:shock:
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Send an http request with the possibility to evaluate the answer

Post by Klaus »

Gille wrote: Sun Mar 10, 2019 10:04 pmHello Klaus,
can we meet in the German-speaking forum?
Klaro, bis denne...
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Send an http request with the possibility to evaluate the answer

Post by Klaus »

I'm waiting! 8)
Post Reply