原创转载请注明出处:http://agilestyle.iteye.com/blog/2406755
GET
curl protocol://address:port/url?args
curl http://127.0.0.1:8080/login?username=hello&password=world
POST
curl -d "args" protocol://address:port/url
curl -d "username=hello&password=world" http://127.0.0.1:8080/login
POST with json body
curl -H "Content-Type: application/json" -X POST --data (json.data) protocol://address:port/url
curl -H "Content-Type: application/json" -X POST --data '{"username": "whoami"}' http://127.0.0.1:8080/login