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
  • 20,268
  • 62
  • 208
  • 382

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
  • 67,054
  • 11
  • 128
  • 154