Getting the contents of a web request using load url
Posted: Sun Oct 27, 2024 1:34 pm
Hi,
Im looking to use load url instead of get to save long pauses in my app.
I have the code
what do I have to add to get the page data? I can see the URL that has been called and its status (cached or error) fine, but I don't know what to do to get the actual page data and cant find any examples anywhere.
Thanks
Im looking to use load url instead of get to save long pauses in my app.
I have the code
Code: Select all
on validateAPI
put "https://www.sample.com/v1/accounts/" into tURL
load url tUrl with message "validationLoaded"
end validateAPI
on validationLoaded pURL, pURLStatus
if pURLStatus is "cached" then
## LiveCode has cached URL content. Accessing the url uses
## the cache.
answer "Result" && pURL
## Remove URL from cache if you are all done with it.
unload url pURL
else
put libURLErrorData(pURL) into tError
answer "Error" && tError
end if
end validationLoaded
Thanks