Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 1, 2017. It is now read-only.

Commit4b9a5e7

Browse files
author
Leon Gersing
committed
adding the changes that will soon land in gist API
References:https://github.com/github/github/pull/24593With:@spicycode
1 parent0345328 commit4b9a5e7

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
kind:change
3+
title:"Gist API now truncates large files"
4+
created_at:2014-04-22
5+
author_name:leongersing
6+
---
7+
8+
In order to provide the most robust, fast and accurate API for Gist we recently decided to make a few small changes to the*files* payload.
9+
10+
###Truncating file contents > 1MB
11+
Sometimes we need to put some large data into a gist. However, we don't always need to see the full content of that large gist when we're fetching the metadata for gists via the API. This change imposes a sensible (according to our data) limit on the amount of raw file data that is returned in gist fetches via the API. If you're relying on reading the full content of individual files from a gist then you may need to update your flow to perform a followup request for the```raw_url``` resource in order to download the entire contents of the file. Which begs the question:*How do I know if the file's contents have been truncated?*
12+
13+
###{ file: { truncated: true, ... } }
14+
On the packets that have been truncated you will notice a new key in the files segment of the payload.
15+
16+
```json
17+
{
18+
files: {
19+
"my_large_file.md": {
20+
"size":2097152,
21+
"raw_url":"path/to/full/contents/of/my_large_file.md",
22+
"type":"text/plain",
23+
"language":"Markdown",
24+
"content":"",
25+
"truncated":true
26+
}
27+
}
28+
}
29+
```
30+
31+
In this small example payload, you'll notice the new*truncated* key has been added and the*content* key's value is empty. This would be a case for making a follow up request to the raw_url, if you are looking to get all of the data that would have normally showed up in the content field.
32+
33+
>Please note that in some cases you may have data in the content field but it has also been truncated. In this case, simply make a follow up request to the raw_url in order recieve the full contents of the file"
34+
35+
If you have any questions, please[get in touch][contact].
36+
37+
[contact]:https://github.com/contact?form[subject]=Gist+API+now+tuncates+large+files

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp