Solved

Issue with cURL on Windows

Posted on 2016-10-04
7
92 Views
Last Modified: 2016-10-27
I have a command that runs fine on Linux but not Windows

curl --silent -X POST -H "host: mytaglist.com" -H "Content-Type: application/json; charset=utf-8" -H "Authorization: bearer XXXXX-0fa9-4258-b8d0-98aa6157d21e" -H "d: """ -H "Cache-Control: no-cache" -H "Postman-Token: XXXXXX-2c1f-96ce-2ca7-033fab5b83fe" -d '' "http://mytaglist.com/ethClient.asmx/GetTagList"

Can anyone help?

note: I've obscured the security credentials
0
Comment
Question by:aideb
  • 3
  • 3
7 Comments
 
LVL 37

Expert Comment

by:Gerwin Jansen
ID: 41829460
How about posting the error you get? That may help us find what's wrong.
0
 
LVL 83

Expert Comment

by:oBdA
ID: 41829807
The first thing to do is to run the command without "-silent".
That said, two issues are already obvious:
- What is -H "d: """ supposed to be? If you want to escape double quotes inside double quotes in a Windows command line, use the backslash as escape character.
- The -d '' "http://mytaglist.com/ethClient.asmx/GetTagList" at the end has a superfluous double quote right after the "-d".
0
 
LVL 2

Author Comment

by:aideb
ID: 41832780
Without --silent the errors are

curl: (6) Could not resolve host: no-cache -H Postman-Token
curl: (6) Could not resolve host: XXXXXX-2c1f-96ce-2ca7-033fab5b83fe -d '' http

I'm not sure of the rationale for the code, I lifted it from something that works on my mac and linux boxes. Strange that it just doesn't work straight off on Windows

After the -d is two single quotes - again I'm unsure of the purpose

Any help would be much appreciated
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 83

Expert Comment

by:oBdA
ID: 41834459
Try
curl --silent -X POST -H "host: mytaglist.com" -H "Content-Type: application/json; charset=utf-8" -H "Authorization: bearer XXXXX-0fa9-4258-b8d0-98aa6157d21e" -H "Cache-Control: no-cache" -H "Postman-Token: XXXXXX-2c1f-96ce-2ca7-033fab5b83fe" -d "http://mytaglist.com/ethClient.asmx/GetTagList"

Open in new window

or
curl --silent -X POST -H "host: mytaglist.com" -H "Content-Type: application/json; charset=utf-8" -H "Authorization: bearer XXXXX-0fa9-4258-b8d0-98aa6157d21e" -H "d: \"\"" -H "Cache-Control: no-cache" -H "Postman-Token: XXXXXX-2c1f-96ce-2ca7-033fab5b83fe" -d "http://mytaglist.com/ethClient.asmx/GetTagList"

Open in new window

0
 
LVL 2

Author Comment

by:aideb
ID: 41838905
Thanks for the suggestion - i get

curl: no URL specified!
0
 
LVL 83

Accepted Solution

by:
oBdA earned 500 total points
ID: 41838949
Then maybe these:
curl --silent -X POST -H "host: mytaglist.com" -H "Content-Type: application/json; charset=utf-8" -H "Authorization: bearer XXXXX-0fa9-4258-b8d0-98aa6157d21e" -H "d: \"\"" -H "Cache-Control: no-cache" -H "Postman-Token: XXXXXX-2c1f-96ce-2ca7-033fab5b83fe" -d "" "http://mytaglist.com/ethClient.asmx/GetTagList"

Open in new window

curl --silent -X POST -H "host: mytaglist.com" -H "Content-Type: application/json; charset=utf-8" -H "Authorization: bearer XXXXX-0fa9-4258-b8d0-98aa6157d21e" -H "Cache-Control: no-cache" -H "Postman-Token: XXXXXX-2c1f-96ce-2ca7-033fab5b83fe" -d "" "http://mytaglist.com/ethClient.asmx/GetTagList"

Open in new window

1
 
LVL 2

Author Closing Comment

by:aideb
ID: 41862944
Thanks  - This one worked!

curl --silent -X POST -H "host: mytaglist.com" -H "Content-Type: application/json; charset=utf-8" -H "Authorization: bearer XXXXX-0fa9-4258-b8d0-98aa6157d21e" -H "d: \"\"" -H "Cache-Control: no-cache" -H "Postman-Token: XXXXXX-2c1f-96ce-2ca7-033fab5b83fe" -d "" "http://mytaglist.com/ethClient.asmx/GetTagList"
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Monitoring local administrators members 6 66
Active Directory uninstall Windows 2008 R2 6 79
TLS/SSL Diable 3DES ciper suites 4 28
How can i echo a ! to end of a file? 8 15
You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
I have published numerous articles here at Experts Exchange that present programs/scripts written in a language called AutoHotkey. Each of those articles has a brief paragraph describing where to download the product and how to install it. I have al…
This tutorial will show how to push an installation of Backup Exec to an additional server in both 2012 and 2014 versions of the software. Click on the Backup Exec button in the upper left corner. From here, select Installation and Licensing, then I…
This tutorial will walk an individual through locating and launching the BEUtility application and how to execute it on the appropriate database. Log onto the server running the Backup Exec database. In a larger environment, this would generally be …

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question