I read the token, and use that as a tHeader variable in my request, but when I run the code I get an error as follows:
Code: Select all
card "Home": execution error at line 8 (Function: error in function handler) near "tsNetGetSync", char 11
Code: Select all
on preOpenCard
put field APIToken on card "Settings" into apiToken
if (apiToken = "") or (apiToken is empty) then
-- just end here and wait.
else
put "https://my.zerotier.com/api/network" into apiUrl
put "Authorization: bearer " && apiToken into apiHeader
put tsNetGetSync(apiUrl, apiHeader, tRecvHeaders, tResult, tBytes) into tData
if tResult is not 200 then
answer "Could not retrieve data"
else
put tData into field apiReturndata
end if
end if
end preOpenCard
Any help is greatly appreciated.
==========================================================
As a small update - I tried this lesson literally with no changes http://lessons.livecode.com/m/4071/l/84 ... a-web-site
And I get the following error:
Code: Select all
execution error at line 3 (Function: error in function handler) near "tsNetGetSync", char 8
==========================================================
Update 2:
I tried some code to test if the connection was up and detected based on a thread lower down in this forum just using
Code: Select all
url("http://www.duckduckgo.com")