xxxxxxxxxx
curl -H "Accept: application/xml" -H "Content-Type: application/xml" -X GET http://hostname/resource
xxxxxxxxxx
curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET http://hostname/resource
xxxxxxxxxx
curl -d "user=user1&pass=abcd" -X POST https://example.com/login
xxxxxxxxxx
# dont forget the content type, else it will throw an error
curl -X POST -H "Content-Type: application/json" \
-d '{"username":"abc","password":"abc"}' \
https://api.example.com/v2/login
xxxxxxxxxx
curl --data '' https://example.com/resource.cgi
curl -X POST https://example.com/resource.cgi
curl --request POST https://example.com/resource.cgi
xxxxxxxxxx
curl-X POST http://localhost:8080/api/guests -H 'Content-Type: application/json' -d '{"lastName":"Zithi", "firstName":"Ans"}'
-H header content
-d json payload/data
xxxxxxxxxx
curl -H "Content-Type: application/json" -d "@data.json" -X POST http://localhost:3000/data