[JS] getting contents from a http request
Hi.
I am working with an api accepts a url containing a server address, a user id, a user password and returns a status.
The compiled url looks like this and when pasted into a browser, displays the status id:
but I need to pass this as part of my Javascript, so as far as I can see I need to encapsulate into an Applescript curl command:
do shell script "curl -0 http://10.1.1.234/login/SearchService?SERVICE_REQUEST_TYPE=38&SERVICE_REQUEST_USERID=11&SERVICE_REQUEST_ASSETID=13444&SERVICE_REQUEST_PASSKEY=*******"
which is passed to Applescript by:
myNumber = app.doScript(myEncodedString, ScriptLanguage.APPLESCRIPT_LANGUAGE);
I get an empty string returned. it looks like the informaton isn't being passed as a page that can be read in this way.
Is there another way I can get a hold of this information that anyone can think of without asking for the api to be re-written? It would be nice to be able to post an http request using js with this api without resorting to writting php code.
Cheers
Roy
