I concur.mwieder wrote: I'd investigate a working flow with WireShark to see what's going on, and then look at the failing instance to see what's different. Browsers will happily follow redirections without clueing you in to what's going on under the hood, while you may have to code this explicitly if you're working at a lower level.
Since you have knowledge and experience with other languages, and since you know that the API is working well... I believe you go a little bit too fast with LiveCode debugging.
I mean no offense.
For instance, on LC's documentation :
The custom header lines specified by the httpHeaders are sent along with a set of default headers. If the headersList includes any header lines that are part of the default headers, the one in the headersList replaces the default header. Any new lines are appended to the end of the headers to be sent to the server.
To replace the default headers instead of adding to them, use the libURLSetCustomHTTPHeaders command instead.
This simple script :
Code: Select all
on mouseup
set the httpheaders to "Content-Type: application/json"
put url "http://www.google.com" into tResult
end mouseup
Code: Select all
GET http://www.google.com/ HTTP/1.1
Host: www.google.com
User-Agent: LiveCode (Win32)
Content-Type: application/json
This is why we asked you to explore with Fiddler or other tools the header that is actually sent when you hit your API with a regular browser.
You didn't answer.
I think it's the only way :
-emulate with Livecode the header that is actually sent with your browser (or your other apps)
Only when this point is settled you can worry about the data received, or that should be received.
Last point : the error "redirect failed". This is coming from your API, not from Livecode. And I think it deserves to be investigated.
And just to give you hope : it will work.

I use LC with several APIs/web services in PHP, Python, with GET, POST, on Odoo servers, mail servers, Sage X3 server... Other have even created libraries for Facebook, Paypal APIs. LC is doing the job. So there is no reason you can not achieve what you want to do.