Network/tutorials/curl-on-windows

= Using Curl on Windows =

The easiest way to get the curl-example snippets to work on Windows is to use Cygwin. Be sure to include curl when installing.

It is possible to run the examples using the Windows native curl port. But the multi line snippets with JSON code must be collapsed to a single line using only double quotes. See the example below.

This snippet: curl -XPOST -H "Content-type: application/json" http://localhost:9090/user-service/users -d ' {  "user" : { "userName" : "snubben" } }'

Must be converted to: curl -XPOST -H "Content-type: application/json" http://localhost:9090/user-service/users -d "{\"user\" : { \"userName\" : \"snubben\" }}"