0

I can't wrap my head around how to escape semicolon in username while making a GET request.

curl -u testclient:sdtest1:pass -XGET -H "Content-type:application/json" \
http://localhost:8081/hello

But the server says that credentials are invalid. How can I escape this?

1
  • 3
    One thing, those aren't semicolons. ; is a semicolon.
    – erikgaal
    Feb 27, 2015 at 12:18

1 Answer 1

1

How do I escape a special character in a username while making a GET request.

Find the hexidecimal value of the value to be escaped, and prefix it with %.

So in your case, use the following:

curl -u testclient%3A:sdtest1:pass ...

"Is there any way that I can specify a username containing a colon"

"user:name:password" => "user%3Aname:password"

Source Specifying colon in authentication username

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .