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.

Commit6946263

Browse files
committed
Add docs for new rate_limit method
1 parent7eaa392 commit6946263

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

‎content/v3.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ receive request bodies:
8686

8787
All error objects have resource and field properties so that your client
8888
can tell what the problem is. There's also an error code to let you
89-
know what is wrong with the field. These are the possible validation error
89+
know what is wrong with the field. These are the possible validation error
9090
codes:
9191

9292
missing
@@ -131,7 +131,7 @@ POST requests.
131131

132132
PUT
133133
: Used for replacing resources or collections. For PUT requests
134-
with no`body` attribute, be sure to set the`Content-Length` header to zero.
134+
with no`body` attribute, be sure to set the`Content-Length` header to zero.
135135

136136
DELETE
137137
: Used for deleting resources.
@@ -164,7 +164,7 @@ are not websites.
164164

165165
Requests that require authentication will return 404, instead of 403, in some places.
166166
This is to prevent the accidental leakage of private repositories to unauthorized
167-
users.
167+
users.
168168

169169
##Pagination
170170

@@ -212,7 +212,16 @@ X-RateLimit-Limit: 5000
212212
X-RateLimit-Remaining: 4966
213213
</pre>
214214

215-
You can[contact us](https://github.com/contact) to request white listed access for your application. We prefer sites that
215+
You can also check your rate limit status without incurring an API hit.
216+
217+
GET /rate_limit
218+
219+
###Rate limit
220+
221+
<%= headers 200 %>
222+
<%= json:rate => {:remaining => 4999,:limit => 5000} %>
223+
224+
Please[contact us](https://github.com/contact) to request white listed access for your application. We prefer sites that
216225
setup OAuth applications for their users.
217226

218227
##Cross Origin Resource Sharing
@@ -225,21 +234,21 @@ HTML 5 Security Guide.
225234
Here's a sample request sent from a browser hitting
226235
`http://some-site.com`:
227236

228-
$ curl -i https://api.github.com -H "Origin: http://some-site.com"
237+
$ curl -i https://api.github.com -H "Origin: http://some-site.com"
229238
HTTP/1.1 302 Found
230239

231240
Any domain that is registered as an OAuth Application is accepted.
232241
Here's a sample request for a browser hitting[Calendar About Nothing](http://calendaraboutnothing.com/):
233242

234-
$ curl -i https://api.github.com -H "Origin: http://calendaraboutnothing.com"
243+
$ curl -i https://api.github.com -H "Origin: http://calendaraboutnothing.com"
235244
HTTP/1.1 302 Found
236245
Access-Control-Allow-Origin: http://calendaraboutnothing.com
237246
Access-Control-Expose-Headers: Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-OAuth-Scopes, X-Accepted-OAuth-Scopes
238247
Access-Control-Allow-Credentials: true
239248

240249
This is what the CORS preflight request looks like:
241250

242-
$ curl -i https://api.github.com -H "Origin: http://calendaraboutnothing.com" -X OPTIONS
251+
$ curl -i https://api.github.com -H "Origin: http://calendaraboutnothing.com" -X OPTIONS
243252
HTTP/1.1 204 No Content
244253
Access-Control-Allow-Origin: http://calendaraboutnothing.com
245254
Access-Control-Allow-Headers: Authorization, X-Requested-With

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp