Cheatsheet Pages / curl Cheatsheet
How to use Basic auth with curl — -u
The endpoint wants a username and password.
curl -u admin:s3cret https://api.example.com/secure
# equivalent: -H "Authorization: Basic YWRtaW46czNjcmV0"
Good to know
-u builds the Authorization: Basic header for you — the commented line in the cheatsheet shows the equivalent header.
