Git Bash on Windows – How to use curl from a windows prompt to make a REST http call

Standard

First create a shell script.

‘c:\Program Files (x86)\Git\etc\curl.sh’

“c:\Program Files (x86)\Git\bin\curl.exe” -i -k -H “Authorization: Basic INSERTbase64HASHhere” -H “Content-Type: application/json” -H “Accept: application/json” -X POST -d ‘{ data: “yay”}’  https://domain/rest/api/values

Now run the shell script from a windows command prompt

c:\Program Files (x86)\Git\bin>sh.exe ../etc/curl.sh

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s