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

Bob Sneidar bobsneidar at iotecdigital.com
Mon Jan 29 11:57:15 EST 2024


When AI reaches full maturity, it will know what you meant. Probably before you coded it. And then it will eat your brain.

Bob S


On Jan 24, 2024, at 4:30 AM, Ben Rubinstein via use-livecode <use-livecode at lists.runrev.com> wrote:

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



More information about the use-livecode mailing list