Tuesday, October 16, 2018

Curl How to send Request with Basic Authorization?

curl --user name:password http://www.example.com 

If you use -u or --user, Curl will Encode the credentials into
Base64 and produce a header like this:
 -H Authorization: Basic

curl -H "Authorization: OAuth " http://www.example.com

If its bearer token, like below the request can be made.

curl -H "Authorization: Bearer " http://www.example.com

references:

https://stackoverflow.com/questions/3044315/how-to-set-the-authorization-header-using-curl

No comments:

Post a Comment