curl --user <name>:<password> http://www.test.com
If you simply specify the user name, curl will prompt for a password:
curl --user <name> http://www.test.com
Also you can encrypt name and password before sending your curl request:
curl -H "Authorization: Basic <your_token>" http://www.test.com
where <your_token> is being generated like that:
-ne "<name>:<password>" | base64 --wrap 0
No comments :
Post a Comment