Example

cURL Authentication Examples

Convert cURL requests that use Bearer tokens, API keys, Basic Auth, cookies, and Authorization headers.

Try Auth Conversion

Bearer tokens and API keys

Authorization headers are preserved as headers so generated code can reproduce token-based API requests.

Basic Auth

The -u user:password option is parsed into an auth object and converted into the target language's Basic Auth pattern when supported.

Secret handling

Use redacted values in the converter and move real credentials into environment variables before using generated code in production.

Authenticated cURL

curl -u 'user:pass' -H 'Authorization: Bearer demo-token' https://api.example.com/account

FAQ

Should I paste real tokens?

No. Use test or redacted tokens in any online converter.

Does -u mean URL?

No. In cURL, -u is for user credentials such as user:password.