tsNetCustomUploadSync: what am I doing wrong?

Ben Rubinstein benr_mc at cogapp.com
Mon Jan 22 16:48:37 EST 2024


I'm trying to use tsNetCustomUploadSync, but something is going wrong.

To establish a baseline, I'm using it to do a POST request. I can prove that 
my data is good because this works:

       set the httpHeaders to tHeaders
       post tRequestData to URL tURL
       put it into fld "ResultData"
       put libUrlLastRhHeaders() into rOutHeaders

This, however:
       put tsNetCustomUploadSync(tURL, "POST", tRequestData, tHeaders, 
rOutHeaders, rResult, rBytes) into fld "ResultData"

returns an 'unauthorized' error, with message "Authentication required".

That suggests that either my URL (which contains part of the application ids 
to which my authorisation token is specific) or my headers (which contains the 
authorisation token) is not being passed correctly.

My guess is that it's more likely to be the headers. Can anyone advise?

TIA,

Ben



More information about the use-livecode mailing list