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 » Fri Mar 08, 2019 9:13 pm

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: 9648
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

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

Post by dunbarx » Fri Mar 08, 2019 9:45 pm

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 » Sat Mar 09, 2019 4:08 pm

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: 720
Joined: Thu Sep 11, 2014 1:49 pm
Location: The Netherlands

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

Post by mrcoollion » Sat Mar 09, 2019 4:19 pm

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: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

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

Post by Klaus » Sat Mar 09, 2019 4:21 pm

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 » Sat Mar 09, 2019 8:43 pm

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 » Sun Mar 10, 2019 10:04 pm

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

Can you trace the query?
:shock:

Klaus
Posts: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

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

Post by Klaus » Sun Mar 10, 2019 11:15 pm

Gille wrote:
Sun Mar 10, 2019 10:04 pm
Hello Klaus,
can we meet in the German-speaking forum?
Klaro, bis denne...

Klaus
Posts: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

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

Post by Klaus » Mon Mar 11, 2019 4:09 pm

I'm waiting! 8)

Post Reply

Return to “Talking LiveCode”