Jun 22, 2018

[curl][admin]

reference:
http://idratherbewriting.com/learnapidoc/docapis_understand_curl.html


Using @json_file_name to post json
curl -H "Content-Type: application/json" -H "Authorization: 123"
-X POST -d @mypostbody.json http://endpointurl.com/example
Show header:
curl -i google.com
Just header:
curl -I http://example.com
Specify action:
HTTP Request Methods
POST PUT GET DELETE
curl -X GET http://example.com
Full example:
curl -X GET -H "Cache-Control: no-cache" 
-H "Postman-Token: 930d08d6-7b2a-6ea2-0725-27324755c684"
"http://api.openweathermap.org/data/2.5/weather?zip=95050%2Cus&appid=fd4698c940c6d1da602a70ac34f0b147&units=imperial"

With Oath2:
curl -H "Authorization: Bearer RsT5OjbzRn430zqMLgV3Ia" \
https://api.authorization-server.com/1/me

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.