Need Help with curl basic auth: How Do I Pass Credentials Correctly?

8 Replies, 1881 Views

Hey! I had the same issue with curl basic auth a while back. Turns out, some APIs expect the credentials in the header instead of using the `-u` flag. Try this:

```
curl -H "Authorization: Basic $(echo -n 'username:password' | base64)" https://example.com
```

Also, special chars in passwords can be tricky. If your password has stuff like `@` or `#`, you might need to URL-encode it. Give it a shot and let me know!

Messages In This Thread



Users browsing this thread: 1 Guest(s)