@@ -86,7 +86,7 @@ receive request bodies:
86
86
87
87
All error objects have resource and field properties so that your client
88
88
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
90
90
codes:
91
91
92
92
missing
@@ -131,7 +131,7 @@ POST requests.
131
131
132
132
PUT
133
133
: 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.
135
135
136
136
DELETE
137
137
: Used for deleting resources.
@@ -164,7 +164,7 @@ are not websites.
164
164
165
165
Requests that require authentication will return 404, instead of 403, in some places.
166
166
This is to prevent the accidental leakage of private repositories to unauthorized
167
- users.
167
+ users.
168
168
169
169
##Pagination
170
170
@@ -212,7 +212,16 @@ X-RateLimit-Limit: 5000
212
212
X-RateLimit-Remaining: 4966
213
213
</pre >
214
214
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
216
225
setup OAuth applications for their users.
217
226
218
227
##Cross Origin Resource Sharing
@@ -225,21 +234,21 @@ HTML 5 Security Guide.
225
234
Here's a sample request sent from a browser hitting
226
235
` http://some-site.com ` :
227
236
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"
229
238
HTTP/1.1 302 Found
230
239
231
240
Any domain that is registered as an OAuth Application is accepted.
232
241
Here's a sample request for a browser hitting[ Calendar About Nothing] ( http://calendaraboutnothing.com/ ) :
233
242
234
- $ curl -i https://api.github.com -H "Origin: http://calendaraboutnothing.com"
243
+ $ curl -i https://api.github.com -H "Origin: http://calendaraboutnothing.com"
235
244
HTTP/1.1 302 Found
236
245
Access-Control-Allow-Origin: http://calendaraboutnothing.com
237
246
Access-Control-Expose-Headers: Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-OAuth-Scopes, X-Accepted-OAuth-Scopes
238
247
Access-Control-Allow-Credentials: true
239
248
240
249
This is what the CORS preflight request looks like:
241
250
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
243
252
HTTP/1.1 204 No Content
244
253
Access-Control-Allow-Origin: http://calendaraboutnothing.com
245
254
Access-Control-Allow-Headers: Authorization, X-Requested-With