Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 4123

Running a curl command via bash returned "URL rejected: Bad hostname", but works on cmdline

$
0
0

When I try to run this cmd via bash like this

Bash Script

mSearchCommand="curl $mSearchCommand --url '${requestURL}'"echo "Search Command $mSearchCommand"mSearchResponse="$(${mSearchCommand})"

Output

Search Command curl -v -X GET --header Authorization:'Bearer ---very long access token---' -s 'https://my-rest-services:443/mypath/someparameters'* URL rejected: Bad hostname* Closing connection* URL rejected: Port number was not a decimal number between 0 and 65535* Closing connection

When I run the follow command on cmd line, it runs perfectly, and returns my json response

curl -v -X GET --header Authorization:'Bearer ---very long access token---' -s 'https://my-rest-services:443/mypath/someparameters'{myjson response}

Viewing all articles
Browse latest Browse all 4123

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>