July 2018
Beginner
264 pages
8h 9m
English
We will learn about HTTP GET and POST methods using curl in Linux. Now, we will see examples of GET and POST:
$ curl -H "Content-Type:application/json" -H "Accept:application/json" -X GET http://host/resource/name
Another example of HTTP GET, which is accepting XML formatted data is as follows:
$ curl -H "Content-Type:application/xml" -H "Accept:application/xml" -X GET http://host/resource/name
A simple POST example is as shown:
$ curl --data "name1=value1&name2=value2" ...
Read now
Unlock full access