curl: PUT

Testing curl PUT commands.

Start by creating an HTTP PUT server:

and run with python SimpleHTTPPutServer.py

then:

curl -XPUT -H "Content-Type: application/json" http://localhost:8000 -d '{"test": null}'

and now you can mess around creating arbitrary PUT commands.

E.g.

  1. spaces don’t matter between -H and quotes.

-H"Content-Type

is the same as:

-H "Content-Type

2. Double quotes == Single quotes. E.g.

-H'Content is OK

3. argument to -dmust be surrounded in quotes. E.g.

-d 'test=test' is OK.

-d test=test is NOT OK.

E.g. see examples here:

https://gist.github.com/subfuzion/08c5d85437d5d4f00e58

 

Leave a Reply

Your email address will not be published. Required fields are marked *