How to send HTTP requests using cURL
Reading a URL via GET:Copy
Defining any HTTP method (like POST or PUT):Copy
curl http://example.com/users/1 -XPUT
Sending data with a request:Copy
curl http://example.com/users -d"first_name=Bruce&last_name=Wayne"
If you use
-dand do not set an HTTP request method it automatically defaults to POST.
Performing basic authentication:Copy
All together now:Copy
curl http://user:email@example.com/users/1 -XPUT -d"screen_name=batman"
Check the man page for more features.
If you are looking for curl-like functionality for an IRB or Rails console, take a look at the rest-client gem.
If you prefer having a GUI, take a look at the Chrome extension Postman.