TheShed

cURL on Windows (thanks Git)

Category: Tools
#Programming

cURL is a nifty little tool for doing things with the web (like HTTP Requests). It's expecially useful for playing with REST APIs...

A coleague was having some fun calling into the REST API of our issue tracking system. A perfect job for cURL I thought, until I remembered that I was VPN'd on a Windows box from a hotel bar...

Fortunately, the Git windows tool set includes Git Bash which includes... cURL

curl -D- -X PUT --data '{ "fields": {"assignee":{"name":"me"}}}' -H "Content-Type:application/json" https://testserver/rest/api/2/issue/Issue-135

curl -D- -X GET -H "Content-Type: application/json" https://testserver/rest/api/2/issue/Issue-134

to the rescue :-)

(Don't forget -u)

PS: I just stumbled on the fact that Git Bash also includes scp. What goodness\tm!