0

Setup: I use the following link to test my REST api in Postman and it works fine:

xxx.xxx.xxx.xxx/API/v1/RefreshTableCache?tables=UniqueLineNumbers,SpoolInfo&jobnumber=1234

Problem: But trying to run it form unix command line it fails.

wget -S -q -O - xxx.xxx.xxx.xxx/API/v1/RefreshTableCache?tables=UniqueLineNumbers,SpoolInfo&jobnumber=1234

Looking at the API output, it is never receiving the jobnumber parameter.

Question:

What is the proper syntax to make wget or even curl pass the parameter??

2
  • 1
    Have you tried adding quotes around the entire url? Commented Apr 17, 2016 at 16:24
  • @peeskillet That was it... I had tried it already.. but I think I was trying a second thing at the same time too. Feel free to post that as an answer and I will accept it. Commented Apr 17, 2016 at 23:25

1 Answer 1

2

The & has a special meaning in the terminal. So when it is used in the URL, it is treated as that special character. To get around that, just wrap the URL in quotes

curl 'http://<...>/path?param1=value1&param2=value2'
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.