Skip to content

Commit d0db12c

Browse files
wolfy1339oscard0m
authored andcommitted
docs: remove previews
1 parent bbaa86c commit d0db12c

File tree

1 file changed

+0
-37
lines changed

1 file changed

+0
-37
lines changed

README.md

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ The `octokit` package integrates the three main Octokit libraries
2222
- [`octokit.rest` endpoint methods](#octokitrest-endpoint-methods)
2323
- [`octokit.request()`](#octokitrequest)
2424
- [Pagination](#pagination)
25-
- [Media Type previews and formats](#media-type-previews-and-formats)
2625
- [GraphQL API queries](#graphql-api-queries)
2726
- [Schema previews](#schema-previews)
2827
- [App client](#app-client)
@@ -513,42 +512,6 @@ const issues = await octokit.paginate(octokit.rest.issues.listForRepo, {
513512
per_page: 100,
514513
});
515514
```
516-
517-
#### Media Type previews and formats
518-
519-
**Note**: The concept of _preview headers_ has been deprecated from REST API endpoints hosted via `api.github.com` but it still exists in GHES (GitHub Enterprise Server) version 3.2 and below. Instead of using _preview headers_ going forward, new features are now being tested using beta previews that users will have to opt-in to.
520-
521-
Media type previews and formats can be set using `mediaType: { format, previews }` on every request. Required API previews are set automatically on the respective REST API endpoint methods.
522-
523-
Example: retrieve the raw content of a `package.json` file
524-
525-
```js
526-
const { data } = await octokit.rest.repos.getContent({
527-
mediaType: {
528-
format: "raw",
529-
},
530-
owner: "octocat",
531-
repo: "hello-world",
532-
path: "package.json",
533-
});
534-
console.log("package name: %s", JSON.parse(data).name);
535-
```
536-
537-
Example: retrieve a repository with topics
538-
539-
```js
540-
const { data } = await octokit.rest.repos.getContent({
541-
mediaType: {
542-
previews: ["mercy"],
543-
},
544-
owner: "octocat",
545-
repo: "hello-world",
546-
});
547-
console.log("topics on octocat/hello-world: %j", data.topics);
548-
```
549-
550-
Learn more about [Media type formats](https://docs.github.com/en/rest/overview/media-types) and [previews](https://docs.github.com/en/[email protected]/rest/overview/api-previews) used on GitHub Enterprise Server.
551-
552515
### GraphQL API queries
553516

554517
Octokit also supports GitHub's GraphQL API directly -- you can use the same queries shown in the documentation and available in the GraphQL explorer in your calls with `octokit.graphql`.

0 commit comments

Comments
 (0)