the requests in Postman, look like this:
curl --location --request GET 'http://nnn.nn.nn.nn:nnn/api/v1/Objects/2213' --header 'Authorization: Basic nnnnnnnnnnnnnnn'
curl --location --request POST 'http://nnn.nn.nn.nn:nnn/api/v1/Objects/2213?6=1' --header 'Authorization: Basic nnnnnnnnnnnnnnn'
and both work ...
and in Applescript, they look like this :
do shell script "curl --location --request GET 'http://nnn.nn.nn.nn:nnn/api/v1/Objects/2213' --header 'Authorization: Basic nnnnnnnnnnnnnnn'"
do shell script "curl --location --request POST 'http://nnn.nn.nn.nn:nnn/api/v1/Objects/2213?6=1' --header 'Authorization: Basic nnnnnnnnnnnnnnn'"
and only the GET works ...
enclosing a string in single quotes - 'abcdef&/whatever' - is a way of ensuring it's passed-on verbatum, without triggering any response from the application that's handling it / sending it on ...
but there seems to be a bug in Applescript ...
Googling a lot, brings up comments pointing to it mishandling things within single quotes within double quotes - as in "abcd 'nhygf' ajyhe" ...
and comments that say we should use quoted form of in strings containing spaces & other special characters (like & and ?) ...
eg: quoted form of (gjsfhjfsafjsdfagh?&jsj) ...
there's also mention of escaping - as in using the \ character to avoid misinterpretation of strings ... as in \" and \\ ...
some of these comments go back almost twenty years ...
I found no examples to illustrate any of their use in our situation, but have experimented with what I could imagine ... without success ... my understanding of all this is very limited, though ...
bottom - line ... Applescript's problem seems to be with the ? character in the POST request, even though it's contained within a string that is enclosed within single quotes ...
so ...question is - is there an alternative to it, within the ultimate destination - within the Cortex API ... ???
PS: did have a look at using Wireshark & Fiddler - but we're running OSX 10.11.6, with which they say they are not compatible ...
references :
https://curl.se/docs/
https://macscripter.net/viewtopic.php?id=22970
https://stackoverflow.com/questions/...in-applescript