cURL
Auth Commands
Handle authentication with cURL across different methods including Basic, Bearer tokens, OAuth, and client certificates. Learn to securely pass credentials when testing protected APIs.
8 commands
Pro Tips
Use 'curl -u user:pass' for Basic auth. Omit the password to get an interactive prompt that won't show in history.
Use 'curl -H "Authorization: Bearer $TOKEN"' for Bearer token auth — store the token in an env var.
Use 'curl --netrc-file ~/.netrc' to store credentials securely outside your shell history.
Common Mistakes
Credentials passed via '-u user:pass' appear in process lists and shell history. Use --netrc or env vars in production.
Always use HTTPS when sending credentials. HTTP sends them in plaintext over the network.