How do I properly use curl basic auth for API authentication?

18 Replies, 1769 Views

Wow, thanks everyone for the detailed replies! I tried the `-u` flag, and it worked like a charm. I also encoded the credentials manually using base64, and that cleared up the issues I was having.

I’m still a bit nervous about the plain text creds, though. I’ll look into using environment variables or a .netrc file like some of you suggested.

One follow-up question: what’s the best way to test APIs with curl basic auth without exposing my credentials? Any tools or methods you’d recommend?

Thanks again, you all rock!

Messages In This Thread



Users browsing this thread: 1 Guest(s)