Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eff741d

Browse files
committed
Remove .v3 from accept header examples.
`v3` header no longer required and has no impact on API requests as per docs so probably shouldn't be in example code. Fixes #21327
1 parent 6e40ab6 commit eff741d

2 files changed

Lines changed: 19 additions & 19 deletions

File tree

content/rest/guides/getting-started-with-the-rest-api.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -292,21 +292,21 @@ jobs:
292292

293293
## Using headers
294294

295-
Most operations specify that you should pass an `Accept` header with a value of `application/vnd.github.v3+json`. Other operations may specify that you should send a different `Accept` header or additional headers.
295+
Most operations specify that you should pass an `Accept` header with a value of `application/vnd.github+json`. Other operations may specify that you should send a different `Accept` header or additional headers.
296296

297297
{% cli %}
298298

299299
To send a header with {% data variables.product.prodname_cli %}, use the `--header` or `-H` flag followed by the header in `key: value` format.
300300

301301
```shell
302-
gh api --header 'Accept: application/vnd.github.v3+json' --method GET /octocat
302+
gh api --header 'Accept: application/vnd.github+json' --method GET /octocat
303303
```
304304

305305
{% endcli %}
306306

307307
{% javascript %}
308308

309-
The Octokit.js library automatically passes the `Accept: application/vnd.github.v3+json` header. To pass additional headers or a different `Accept` header, add a `headers` property to the object that is passed as a second argument to the `request` method. The value of the `headers` property is an object with the header names as keys and header values as values. For example, to send a `content-type` header with a value of `text/plain`:
309+
The Octokit.js library automatically passes the `Accept: application/vnd.github+json` header. To pass additional headers or a different `Accept` header, add a `headers` property to the object that is passed as a second argument to the `request` method. The value of the `headers` property is an object with the header names as keys and header values as values. For example, to send a `content-type` header with a value of `text/plain`:
310310

311311
```javascript
312312
await octokit.request("GET /octocat", {
@@ -325,7 +325,7 @@ To send a header with cURL, use the `--header` or `-H` flag followed by the head
325325
```shell
326326
curl --request GET \
327327
--url "https://api.github.com/octocat" \
328-
--header "Accept: application/vnd.github.v3+json" \
328+
--header "Accept: application/vnd.github+json" \
329329
--header "Authorization: Bearer YOUR-TOKEN"
330330
```
331331

@@ -348,7 +348,7 @@ Path parameters modify the operation path. For example, the "List repository iss
348348
To get issues from the `octocat/Spoon-Knife` repository, replace `{owner}` with `octocat` and `{repo}` with `Spoon-Knife`.
349349

350350
```shell
351-
gh api --header 'Accept: application/vnd.github.v3+json' --method GET /repos/octocat/Spoon-Knife/issues
351+
gh api --header 'Accept: application/vnd.github+json' --method GET /repos/octocat/Spoon-Knife/issues
352352
```
353353

354354
{% endcli %}
@@ -389,7 +389,7 @@ To get issues from the `octocat/Spoon-Knife` repository, replace `{owner}` with
389389
```shell
390390
curl --request GET \
391391
--url "https://api.github.com/repos/octocat/Spoon-Knife/issues" \
392-
--header "Accept: application/vnd.github.v3+json" \
392+
--header "Accept: application/vnd.github+json" \
393393
--header "Authorization: Bearer YOUR-TOKEN"
394394
```
395395

@@ -414,7 +414,7 @@ For {% data variables.product.prodname_cli %}, use the `-F` flag to pass a param
414414
{% endnote %}
415415

416416
```shell
417-
gh api --header 'Accept: application/vnd.github.v3+json' --method GET /repos/octocat/Spoon-Knife/issues -F per_page=2 -f sort=updated -f direction=asc
417+
gh api --header 'Accept: application/vnd.github+json' --method GET /repos/octocat/Spoon-Knife/issues -F per_page=2 -f sort=updated -f direction=asc
418418
```
419419

420420
{% endcli %}
@@ -442,7 +442,7 @@ For cURL, add a `?` to the end of the path, then append your query parameter nam
442442
```shell
443443
curl --request GET \
444444
--url "https://api.github.com/repos/octocat/Spoon-Knife/issues?per_page=2&sort=updated&direction=asc" \
445-
--header "Accept: application/vnd.github.v3+json" \
445+
--header "Accept: application/vnd.github+json" \
446446
--header "Authorization: Bearer YOUR-TOKEN"
447447
```
448448

@@ -467,7 +467,7 @@ For {% data variables.product.prodname_cli %}, use the `-F` flag to pass a param
467467
{% endnote %}
468468

469469
```shell
470-
gh api --header 'Accept: application/vnd.github.v3+json' --method POST /repos/octocat/Spoon-Knife/issues -f title="Created with the REST API" -f body="This is a test issue created by the REST API"
470+
gh api --header 'Accept: application/vnd.github+json' --method POST /repos/octocat/Spoon-Knife/issues -f title="Created with the REST API" -f body="This is a test issue created by the REST API"
471471
```
472472

473473
{% endcli %}
@@ -494,7 +494,7 @@ For cURL, use the `--data` flag to pass the body parameters in a JSON object.
494494
```shell
495495
curl --request POST \
496496
--url "https://api.github.com/repos/octocat/Spoon-Knife/issues" \
497-
--header "Accept: application/vnd.github.v3+json" \
497+
--header "Accept: application/vnd.github+json" \
498498
--header "Authorization: Bearer YOUR-TOKEN" \
499499
--data '{
500500
"title": "Created with the REST API",
@@ -521,7 +521,7 @@ To view the status code and headers, use the `--include` or `--i` flag when you
521521
For example, this request:
522522

523523
```shell
524-
gh api --header 'Accept: application/vnd.github.v3+json' --method GET /repos/octocat/Spoon-Knife/issues -F per_page=2 --include
524+
gh api --header 'Accept: application/vnd.github+json' --method GET /repos/octocat/Spoon-Knife/issues -F per_page=2 --include
525525
```
526526

527527
returns the response code and headers like:
@@ -592,7 +592,7 @@ For example, this request:
592592
```shell
593593
curl --request GET \
594594
--url "https://api.github.com/repos/octocat/Spoon-Knife/issues?per_page=2" \
595-
--header "Accept: application/vnd.github.v3+json" \
595+
--header "Accept: application/vnd.github+json" \
596596
--header "Authorization: Bearer YOUR-TOKEN" \
597597
--include
598598
```
@@ -638,7 +638,7 @@ Many operations will return a response body. Unless otherwise specified, the res
638638
{% cli %}
639639

640640
```shell
641-
gh api --header 'Accept: application/vnd.github.v3+json' --method GET /repos/octocat/Spoon-Knife/issues -F per_page=2
641+
gh api --header 'Accept: application/vnd.github+json' --method GET /repos/octocat/Spoon-Knife/issues -F per_page=2
642642
```
643643

644644
{% endcli %}
@@ -660,7 +660,7 @@ await octokit.request("GET /repos/{owner}/{repo}/issues", {
660660
```shell
661661
curl --request GET \
662662
--url "https://api.github.com/repos/octocat/Spoon-Knife/issues?per_page=2" \
663-
--header "Accept: application/vnd.github.v3+json" \
663+
--header "Accept: application/vnd.github+json" \
664664
--header "Authorization: Bearer YOUR-TOKEN"
665665
```
666666

@@ -673,7 +673,7 @@ Unlike the GraphQL API where you specify what information you want, the REST API
673673
For example, you can use `>` to redirect the response to a file:
674674

675675
```shell
676-
gh api --header 'Accept: application/vnd.github.v3+json' --method GET /repos/octocat/Spoon-Knife/issues -F per_page=2 > data.json
676+
gh api --header 'Accept: application/vnd.github+json' --method GET /repos/octocat/Spoon-Knife/issues -F per_page=2 > data.json
677677
```
678678

679679
Then you can use jq to get the title and author ID of each issue:
@@ -729,7 +729,7 @@ For example, you can use `>` to redirect the response to a file:
729729
```shell
730730
curl --request GET \
731731
--url "https://api.github.com/repos/octocat/Spoon-Knife/issues?per_page=2" \
732-
--header "Accept: application/vnd.github.v3+json" \
732+
--header "Accept: application/vnd.github+json" \
733733
--header "Authorization: Bearer YOUR-TOKEN" > data.json
734734
```
735735

content/rest/quickstart.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ jobs:
278278
```shell
279279
curl --request GET \
280280
--url "https://api.github.com/repos/octocat/Spoon-Knife/issues" \
281-
--header "Accept: application/vnd.github.v3+json" \
281+
--header "Accept: application/vnd.github+json" \
282282
--header "Authorization: Bearer YOUR-TOKEN"
283283
```
284284

@@ -308,7 +308,7 @@ jobs:
308308
run: |
309309
curl --request GET \
310310
--url "https://api.github.com/repos/octocat/Spoon-Knife/issues" \
311-
--header "Accept: application/vnd.github.v3+json" \
311+
--header "Accept: application/vnd.github+json" \
312312
--header "Authorization: Bearer $GH_TOKEN"
313313
```
314314

@@ -340,7 +340,7 @@ jobs:
340340
run: |
341341
curl --request GET \
342342
--url "https://api.github.com/repos/octocat/Spoon-Knife/issues" \
343-
--header "Accept: application/vnd.github.v3+json" \
343+
--header "Accept: application/vnd.github+json" \
344344
--header "Authorization: Bearer $GH_TOKEN"
345345
```
346346

0 commit comments

Comments
 (0)