Commit 8430d85d authored by Craig Norris's avatar Craig Norris

Merge branch 'docs-fix-curl-url-quoting' into 'master'

Docs: use double quotes for URLs in cURL commands

See merge request gitlab-org/gitlab!41189
parents 3566103a b0cc0718
...@@ -1943,7 +1943,7 @@ METHOD /endpoint ...@@ -1943,7 +1943,7 @@ METHOD /endpoint
Example request: Example request:
```shell ```shell
curl --header "PRIVATE-TOKEN: <your_access_token>" 'https://gitlab.example.com/api/v4/endpoint?parameters' curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/endpoint?parameters"
``` ```
Example response: Example response:
...@@ -2038,7 +2038,7 @@ you can use in the API documentation. ...@@ -2038,7 +2038,7 @@ you can use in the API documentation.
Get the details of a group: Get the details of a group:
```shell ```shell
curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/groups/gitlab-org curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/gitlab-org"
``` ```
#### cURL example with parameters passed in the URL #### cURL example with parameters passed in the URL
...@@ -2066,7 +2066,7 @@ In this example we create a new group. Watch carefully the single and double ...@@ -2066,7 +2066,7 @@ In this example we create a new group. Watch carefully the single and double
quotes. quotes.
```shell ```shell
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --header "Content-Type: application/json" --data '{"path": "my-group", "name": "My group"}' https://gitlab.example.com/api/v4/groups curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --header "Content-Type: application/json" --data '{"path": "my-group", "name": "My group"}' "https://gitlab.example.com/api/v4/groups"
``` ```
#### Post data using form-data #### Post data using form-data
...@@ -2075,7 +2075,7 @@ Instead of using JSON or urlencode you can use multipart/form-data which ...@@ -2075,7 +2075,7 @@ Instead of using JSON or urlencode you can use multipart/form-data which
properly handles data encoding: properly handles data encoding:
```shell ```shell
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --form "title=ssh-key" --form "key=ssh-rsa AAAAB3NzaC1yc2EA..." https://gitlab.example.com/api/v4/users/25/keys curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" --form "title=ssh-key" --form "key=ssh-rsa AAAAB3NzaC1yc2EA..." "https://gitlab.example.com/api/v4/users/25/keys"
``` ```
The above example is run by and administrator and will add an SSH public key The above example is run by and administrator and will add an SSH public key
...@@ -2101,7 +2101,7 @@ exclude specific users when requesting a list of users for a project, you would ...@@ -2101,7 +2101,7 @@ exclude specific users when requesting a list of users for a project, you would
do something like this: do something like this:
```shell ```shell
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" --data "skip_users[]=<user_id>" --data "skip_users[]=<user_id>" https://gitlab.example.com/api/v4/projects/<project_id>/users curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" --data "skip_users[]=<user_id>" --data "skip_users[]=<user_id>" "https://gitlab.example.com/api/v4/projects/<project_id>/users"
``` ```
## GraphQL API ## GraphQL API
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment