diff options
| author | Achilleas Pipinellis <axilleas@axilleas.me> | 2016-08-10 06:12:27 +0000 |
|---|---|---|
| committer | Achilleas Pipinellis <axilleas@axilleas.me> | 2016-08-10 06:12:27 +0000 |
| commit | 68097a3a5c70276a969652e838250854537e23d7 (patch) | |
| tree | 12fffd90b5d4c5e9c6b97c4aa7b2938ce2c19748 /doc/api/README.md | |
| parent | 2aad2f0504633ac70069bb0e1f8739c140417fa6 (diff) | |
| parent | 314647459c07e9f920dfcf43a8644e2199f1132c (diff) | |
| download | gitlab-ce-68097a3a5c70276a969652e838250854537e23d7.tar.gz | |
Merge branch 'api-examples-curl-long-options' into 'master'
Use long options for curl examples in documentation
## What does this MR do?
Use long options (e.g. `--header` instead of `-H`) for curl examples in documentation.
## Why was this MR needed?
Short options are less readable.
## What are the relevant issue numbers?
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5465#note_13603730
See merge request !5703
Diffstat (limited to 'doc/api/README.md')
| -rw-r--r-- | doc/api/README.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/api/README.md b/doc/api/README.md index 21141d350cf..a357af3831d 100644 --- a/doc/api/README.md +++ b/doc/api/README.md @@ -74,7 +74,7 @@ You can use an OAuth 2 token to authenticate with the API by passing it either i Example of using the OAuth2 token in the header: ```shell -curl -H "Authorization: Bearer OAUTH-TOKEN" https://gitlab.example.com/api/v3/projects +curl --header "Authorization: Bearer OAUTH-TOKEN" https://gitlab.example.com/api/v3/projects ``` Read more about [GitLab as an OAuth2 client](oauth2.md). @@ -204,7 +204,7 @@ resources you can pass the following parameters: In the example below, we list 50 [namespaces](namespaces.md) per page. ```bash -curl -X PUT -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/namespaces?per_page=50 +curl --request PUT --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/namespaces?per_page=50 ``` ### Pagination Link header @@ -218,7 +218,7 @@ and we request the second page (`page=2`) of [comments](notes.md) of the issue with ID `8` which belongs to the project with ID `8`: ```bash -curl -I -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/projects/8/issues/8/notes?per_page=3&page=2 +curl --head --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/projects/8/issues/8/notes?per_page=3&page=2 ``` The response will then be: |
