How to use HTTP Basic authentication with cURL

Written by Yujin Boby

Edit in WordPress

To access sites that use HTTP Basic authentication with curl, use command

curl -u USERNAME_HERE:PASSWORD_HERE http://domain.extn

Or

curl -u USERNAME_HERE http://domain.extn

If you don’t specify password, curl will promt for password.

See curl