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.

Commit983f527

Browse files
author
Peter Williams
committed
Document redirection behavior of api
1 parentb73b251 commit983f527

File tree

3 files changed

+26
-4
lines changed

3 files changed

+26
-4
lines changed

‎content/v3.md‎

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,19 @@ already\_exists
120120
can happen in resources that must have some unique key (such as Label
121121
names).
122122

123-
If resources have custom validation errors, they will be documented with
124-
the resource.
123+
If resources have custom validation errors, they will be documented with the resource.
124+
125+
##HTTP Redirects
126+
127+
API v3 uses HTTP redirection where appropriate. Clients should assume that any request may result in a redirection. Receiving an HTTP redirection is*not* an error and clients should follow that redirect. Redirect responses will have a`Location` header field which contains the URI of the resource to which the client should repeat the requests.
128+
129+
301
130+
: Permanent redirection. The URI you used to make the request has be superseded by the one specified in the`Location` header field. This and all future requests to this resource should be directed the new URI.
131+
132+
302, 307
133+
: Temporary redirection. The request should be repeated verbatim to the URI specified in the`Location` header field but clients should continue to use the original URI for future requests.
134+
135+
Other redirection status codes may be used in accordance with the HTTP 1.1 spec.
125136

126137
##HTTP Verbs
127138

@@ -185,7 +196,7 @@ users.
185196
##Pagination
186197

187198
Requests that return multiple items will be paginated to 30 items by
188-
default. You can specify further pages with the`?page` parameter.For some
199+
default. You can specify further pages with the`?page` parameter. For some
189200
resources, you can also set a custom page size up to 100 with the`?per_page` parameter.
190201
Note that for technical reasons not all endpoints respect the`?per_page` parameter,
191202
see[events](http://developer.github.com/v3/events/) for example.
@@ -389,4 +400,3 @@ A link that looks like this:
389400
<%= json "Link" =>[
390401
["url1", {:rel => "next"}],
391402
["url2", {:rel => "foo",:bar => "baz"}]] %>
392-

‎content/v3/orgs/members.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,14 @@ members will be returned. Otherwise only public members are returned.
2121
<%= headers 200 %>
2222
<%= json(:user) { |h|[h] } %>
2323

24+
###Response if requester is not a organization member
25+
26+
<%= headers 302, "Location" => "https://api.github.com/orgs/github/public_members" %>
27+
2428
##Get member
2529

30+
Check if a user is, publicly or privately, a member of the organization.
31+
2632
GET /orgs/:org/members/:user
2733

2834
###Response if user is a member
@@ -33,6 +39,10 @@ members will be returned. Otherwise only public members are returned.
3339

3440
<%= headers 404 %>
3541

42+
###Response if requester is not a organization member
43+
44+
<%= headers 302,:Location => "https://api.github.com/orgs/github/public_members/pezra" %>
45+
3646
##Add a member
3747

3848
To add someone as a member to an org, you must add them to a

‎lib/resources.rb‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ module Helpers
1212
202=>'202 Accepted',
1313
204=>'204 No Content',
1414
301=>'301 Moved Permanently',
15+
302=>'302 Found',
16+
307=>'307 Temporary Redirect',
1517
304=>'304 Not Modified',
1618
401=>'401 Unauthorized',
1719
403=>'403 Forbidden',

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp