• Software
  • Equivalent of curl in the Windows' command prompt?

Hey guys,

I often need to use curl when testing API's so I try to use the same command off the API's documentation but it does not work. Apparently, this "curl" thing (shell?) is only available for Mac and Linux users. Is there a way I could do the same thing in Windows?
You can grab a copy for Windows here. This is the cURL home page.

curl is truly awesome. It's not a shell, it's a powerful tool. If something has a URL, then cURL can grab it for you. It also follows the Unix philosophy, making it easy to combine with other programs to make wonderful things happen.
Thanks saeidw :)

Ok now another question... How does the following translate into an HTTP request:
curl -k -u MERCHANT_ID:MERCHANT_KEY -d "_type=hello" "https://sandbox.google.com/checkout/api/checkout/v2/requestForm/Merchant/MERCHANT_ID"
What I am trying to say, if I have an HTML form, what would be the action attribute? Only the url part or does _type get appended some way?
When you're POSTing an HTML form the "action" is specified by the form, you don't pass it as a parameter.

the -d flag in curl is the equivalent of --data: thats the data of the form you're submitting. So assuming your form has a field called "_type" it will be submitted with the value "hello".

Take a look at this for more details: http://curl.haxx.se/docs/httpscripting.html
vic wroteWhen you're POSTing an HTML form the "action" is specified by the form, you don't pass it as a parameter.
Oh God! Now I feel like a dumbass that knows nothing about HTML. Thanks for reminding me of what the action attribute is :)
vic wrotethe -d flag in curl is the equivalent of --data: thats the data of the form you're submitting. So assuming your form has a field called "_type" it will be submitted with the value "hello".
Aha, that means all the name:value pairs after the -d flag should be placed inside the form as input tags. But for some reason that is not working! Take a look: http://stackoverflow.com/questions/6285578/getting-started-with-asp-net-mvc3-google-checkout