Monday, April 21, 2008

POSTing and PUTting from cURL

>curl -X PUT -d "post[title]=first post from curl" "http://localhost:3000/posts/1" -H "Accept: text/xml"

>curl -d "post[title]=first post from curl" "http://localhost:3000/posts" -H "Accept: text/xml"

-X POST is not needed in the second command because the default is POST when -d flag is used.

No comments: