2
$ curl -k -i -X POST -d '{ "path" : "/" }' https://abc@example.com:qwer@@53096wrxgcg.ibmaspera.com:33001/files/workspaces/42796/all/12345:2

results in:

curl: (3) Port number ended with 'I'

Without @:

$ curl -k -i -X POST -d '{ "path" : "/" }' https://abcexample.com:qwer@53096wrxgcg.ibmaspera.com:33001/files/workspaces/42796/all/12345:2

results in:

curl: (7) Failed to connect to 53096wrxgcg.ibmaspera.com port 33001: Connection timed out

How to specify @ in username and password for curl command?

Aquarius_Girl
  • 21,790
  • 65
  • 230
  • 411

1 Answers1

2

If the auth username or password contain an @ symbol, it should be urlencoded to %40.

Your curl command could look like either of these examples:

curl -k -i -X POST -d '{ "path" : "/" }' \ 
  https://abc%40example.com:qwer%40@53096wrxgcg.ibmaspera.com:33001/files/workspaces/42796/all/12345:2

or

curl --user abc%40example.com:qwer%40 -k -i ...
drew010
  • 68,777
  • 11
  • 134
  • 162