openterm icon indicating copy to clipboard operation
openterm copied to clipboard

curl inside captureShell

Open matthiaw opened this issue 6 years ago • 1 comments

I tried to make a script with

info = captureShell("curl --request GET --url 'https://your-domain.atlassian.net/wiki/rest/api/settings/systemInfo' --user '[email protected]:<api_token>' --header 'Accept: application/json') println(info)

I use for this https://developer.atlassian.com/cloud/confluence/rest/#api-settings-systemInfo-get

I have a working account at confluence and on OpenTerm everything works perfect with the curl-command.

But in script-mode i get the correct REST-Result and

{json-result}curl: (6) Could not resolve host: --request curl: (6) Could not resolve host: GET curl: (6) Could not resolve host: --url curl: (6) Could not resolve host: --user curl: (3) Port number ended with 'c' curl: (6) Could not resolve host: --header curl: (3) Port number ended with ' '

This seems strange. Need i to escape something?

matthiaw avatar Aug 20 '18 22:08 matthiaw

Ok i found a workaround-solution over a temporary file:

captureShell("curl --request ... | tee tmp.txt") info = captureShell("cat tmp.txt") println(info) captureShell("rm tmp.txt")

matthiaw avatar Aug 30 '18 20:08 matthiaw