You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/rest/guides/getting-started-with-the-rest-api.md
+16-16Lines changed: 16 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -292,21 +292,21 @@ jobs:
292
292
293
293
## Using headers
294
294
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.
296
296
297
297
{% cli %}
298
298
299
299
To send a header with {% data variables.product.prodname_cli %}, use the `--header` or `-H` flag followed by the header in `key: value` format.
300
300
301
301
```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
303
303
```
304
304
305
305
{% endcli %}
306
306
307
307
{% javascript %}
308
308
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`:
310
310
311
311
```javascript
312
312
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
@@ -467,7 +467,7 @@ For {% data variables.product.prodname_cli %}, use the `-F` flag to pass a param
467
467
{% endnote %}
468
468
469
469
```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"
471
471
```
472
472
473
473
{% endcli %}
@@ -494,7 +494,7 @@ For cURL, use the `--data` flag to pass the body parameters in a JSON object.
0 commit comments