Skip to content

Commit 5d0408a

Browse files
author
hubot
committed
Merge pull request github#581 from github/update-1408469152
2 parents e114730 + 16efe7c commit 5d0408a

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

content/v3/gists.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ You can read public gists and create them for anonymous users without a token; h
1515
1616
The API will return a 401 "Bad credentials" response if the gists scope was given to the application but the credentials are invalid. -->
1717

18+
## Truncation
19+
20+
The Gist API provides up to one megabyte of content for each file in the gist. Every call to retrieve a gist through the API has a key called `truncated`. If `truncated` is `true`, the file is too large and only a portion of the contents were returned in `content`.
21+
22+
If you need the full contents of the file, you can make a `GET` request to the URL specified by `raw_url`. Be aware that for files larger than ten megabytes, you'll need to clone the gist via the URL provided by `git_pull_url`.
23+
1824
## List gists
1925

2026
List a user's gists:

lib/resources.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,6 +1249,7 @@ def fetch_content(key)
12491249
"size" => 932,
12501250
"raw_url" => "https://gist.githubusercontent.com/raw/365370/8c4d2d43d178df44f4c03a7f2ac0ff512853564e/ring.erl",
12511251
"type" => "text/plain",
1252+
"truncated" => false,
12521253
"language" => "Erlang"
12531254
}
12541255
}

0 commit comments

Comments
 (0)