November 30, 2017

curl Usage

HTTP request method:
  • -X POST
  • -X PUT
HTTP request Content-Type header
  • -H "Content-Type: application/x-www-form-urlencoded"
  • -H "Content-Type: application/json"
HTTP request body/data
  • form urlencoded: -d "param1=value1&param2=value2"
  • json: -d '{"key1":"value1", "key2":"value2"}'
Examples

curl -X GET http://www.google.se

curl -d "param1=value1&param2=value2" -H "Content-Type: application/x-www-form-urlencoded" -X POST http://localhost:3000/data

curl -d '{"key1":"value1", "key2":"value2"}' -H "Content-Type: application/json" -X POST http://localhost:3000/data

https://gist.github.com/subfuzion/08c5d85437d5d4f00e58

1 comment:

shaik riaz said...

Excellent Work Magnus... You are doing a great job. Keep it up. This is very helpful for all those people who want to learn in depth about Jboss EAP. I am getting loads of knowledge from your articles.

The most important part is that all your mentioned configuration procedures are working 100% and that speaks the volumes of your expertise...

HATSOFF SIR.....THANK YOU VERY MUCH FOR TAKING YOUR VALUABLE TIME AND SHARING WITH US.....IF I HAVE ANY DOUBTS PLEASE CLARIFY ME, MY GMAIL (riaz.06k@gmail.com, MOBILE: +91-9014988842) AVAILABLE ON GOOGLE DUO. PLEASE PLEASE PLEASE SIR...

THANK YOU VERY MUCH.... WITH LOVE AND WARM REGARDS....YOUR STUDENT