Any cURL equivalent? HTTP POST/GET?


(lukehawk) #1

I am very new to automise, but pretty familiar with scripting languages (VBScript, Python). The following is what I can run in the command line to use curl to get a comma separated value back from an API server:

curl -X POST --user username:password --data-raw “Request=GET%2C%2892837F755%29” http://example.com/cgi/stuff

What would be the action I could use to run this? I found the HTTP Get File action, but I am not downloading a file. I am simply reading a string.

I have tried using the PowerShell script, but I cannot figure out  how to get the response out of PowerShell and into Automise. 

Any help?? How would I do this?


Thanks!!

(lukehawk) #2

Oh -

I have also tried the ‘Run Script’ action, using VBScript, but how do I get variables in and out of the script?


(Jason Smith) #3

Hi Luke,

Saw your question in our support section, just encase you didn’t see this response I thought I would post it here:

Your best bet would be to use curls file output feature to save the response (–output). You could load this file into a variable and parse it for the values you want.

If the output is Json, you could use a JavaScript action to Eval the object, and then extract the property you require. This has risks however.

The best way would be to use regex, or a string find action to locate the property your after and copy its value to another variable.