cURL で GET/POST/PUT/DELETE

-X オプションでメソッド名 GET/POST/PUT/DELETE を指定すればよい。

curl -X PUT -d 'example[foo]=bar' -d 'example[jane]=doe' http://example.com/api/1/example/1.json

Basic 認証をしたいときにはさらに –basic –user user:password をつける。

curl --basic --user user:password -X PUT -d 'example[foo]=bar' -d 'example[jane]=doe' http://example.com/api/1/example/1.json

API を開発したいときには cURL様々!!!

参考文献