tsNetCustomUploadSync: what am I doing wrong? (Answer: RTFM-P)

Ben Rubinstein benr at cogapp.com
Wed Jan 24 07:30:52 EST 2024


For the record:

 > put tsNetCustomUploadSync(tURL, "POST", tRequestData, tHeaders, ...

should have been

 > put tsNetCustomUploadSync(tURL, "POST", tHeaders, tRequestData, ...

:facepalm-emoji:

Ben

On 22/01/2024 21:48, Ben Rubinstein via use-livecode wrote:
> 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
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode



More information about the use-livecode mailing list