Skip to content
This repository has been archived by the owner on Feb 13, 2019. It is now read-only.

curl inside captureShell #153

Open
matthiaw opened this issue Aug 20, 2018 · 1 comment
Open

curl inside captureShell #153

matthiaw opened this issue Aug 20, 2018 · 1 comment

Comments

@matthiaw
Copy link

matthiaw commented Aug 20, 2018

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
Copy link
Author

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")

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant