API Get Request in LiveCode

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
wmiriye
Posts: 24
Joined: Tue Jun 02, 2020 4:09 am

API Get Request in LiveCode

Post by wmiriye » Thu Jun 04, 2020 2:40 am

I am trying to connect to my Laravel application using API. I tested everything in postman and the results are being returned in JSON as expected. In Live code, how to I make the GET request. The POST request for logging in and getting the access token is fine but I am having issues with the GET request.

Once I get the access token back, the service provider requires the access toke to be provided in the header when the user logs in. I have that setup in LiveCode UI.

I need help on how to set this token in the header and then do the GET request call which should return the values. However, I was not able to find specific examples for using a header token and doing a GET request in LiveCode. Any help will be greatly appreciated.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10049
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: API Get Request in LiveCode

Post by FourthWorld » Thu Jun 04, 2020 8:29 am

Did you see the GET command in the Dictionary?
https://livecode.com/resources/api/#livecode_script/get
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7392
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: API Get Request in LiveCode

Post by jacque » Thu Jun 04, 2020 5:14 pm

You can set the headers using the httpHeaders property. The "get url" command does a GET request.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply