apicurlterminalspecial-characters

curl: Quotation character in password for basic authorization


I am trying to call an API with basic authorization using curl, and am facing a problem where the password contains special characters, specifically quotation mark ("). How can I send a request with such parameters?

Example: username: myusername
password: pass"12<o

curl -k -u myusername:pass"12<o https://www.myurl.com/endpoint

Solution

  • Try this:

    curl -k -u 'myusername:pass"12<o' https://www.myurl.com/endpoint