## POST examples with `curl` For details and more examples, see the [POST](http://curl.haxx.se/docs/httpscripting.html#POST) section of the official tutorial. --- In the examples below, suppose we need to POST data to `https://foo.io/users/joyrexus/shoes`, the canonical address for the shoes resource (a "collection" resource, in REST-speak) of a particular user (`joyrexus`): URL=https://foo.io/users/joyrexus/shoes #### Url-encoded curl -d "brand=nike" -d "color=red" -d "size=11" $URL curl --data "brand=nike&color=red&size=11" $URL #### Multipart curl --form "image=@nikes.png" --form "brand=nike" --form "color=red" --form "size=11" $URL curl -F "image=@nikes.png" -F "brand=nike" -F "color=red" -F "size=11" $URL Change the name field of a file upload part by setting `filename=`: curl -F "image=@nikes.png;filename={desired-name}.png" -F "brand=nike" -F "color=red" -F "size=11" $URL Specify `Content-Type` by using `type=`: curl -F "image=@nikes.png;filename={desired-name}.png;type=image/png" -F "brand=nike" -F "color=red" -F "size=11" $URL #### Sans data curl --data '' $URL curl -X POST $URL curl --request POST $URL