Solved

Issue with cURL on Windows

Posted on 2016-10-04
7
67 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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

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…
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…

757 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now