Skip to content

Commit 4d1fcc3

Browse files
authored
Revise Management console API Authentication curl example
Current `curl` example doesn't work if the Management Console password contains `@` character. ``` #!/bin/bash set -eu export your_amazing_password=foo@bar export hostname=my-ghes.example.com curl -L https://api_key:${your_amazing_password}@${hostname}:8443/setup/api ``` ``` $ bash maintenance-demo.sh curl: (6) Could not resolve host: bar@my-ghes.example.com ``` `curl -u (--user)` option solves the problem.
1 parent 5933365 commit 4d1fcc3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

content/rest/reference/enterprise-admin.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ $ curl -L 'https://<em>hostname</em>:<em>admin_port</em>/setup/api?api_key=<em>y
183183
You can also use standard HTTP authentication to send this token. For example:
184184

185185
```shell
186-
$ curl -L 'https://api_key:<em>your-amazing-password</em>@<em>hostname</em>:<em>admin_port</em>/setup/api'
186+
$ curl -L -u "api_key:<em>your-amazing-password</em>" 'https://<em>hostname</em>:<em>admin_port</em>/setup/api'
187187
```
188188

189189
{% for operation in currentRestOperations %}

0 commit comments

Comments
 (0)