зеркало из https://github.com/github/docs.git
Correct curl params to match output in examples
This commit is contained in:
Родитель
101e50387a
Коммит
ea92d43128
|
@ -31,7 +31,7 @@ For information about GitHub's GraphQL API, see the [v4 documentation](/graphql)
|
|||
sent and received as JSON.
|
||||
|
||||
```shell
|
||||
$ curl -i {% data variables.product.api_url_pre %}/users/octocat/orgs
|
||||
$ curl -I {% data variables.product.api_url_pre %}/users/octocat/orgs
|
||||
|
||||
> HTTP/1.1 200 OK
|
||||
> Server: nginx
|
||||
|
@ -137,7 +137,7 @@ Read [more about unauthenticated rate limiting](#increasing-the-unauthenticated-
|
|||
Authenticating with invalid credentials will return `401 Unauthorized`:
|
||||
|
||||
```shell
|
||||
$ curl -i {% data variables.product.api_url_pre %} -u foo:bar
|
||||
$ curl -I {% data variables.product.api_url_pre %} -u foo:bar
|
||||
> HTTP/1.1 401 Unauthorized
|
||||
|
||||
> {
|
||||
|
@ -369,7 +369,7 @@ Note that [the Search API has custom rate limit rules](/rest/reference/search#ra
|
|||
The returned HTTP headers of any API request show your current rate limit status:
|
||||
|
||||
```shell
|
||||
$ curl -i {% data variables.product.api_url_pre %}/users/octocat
|
||||
$ curl -I {% data variables.product.api_url_pre %}/users/octocat
|
||||
> HTTP/1.1 200 OK
|
||||
> Date: Mon, 01 Jul 2013 17:27:06 GMT
|
||||
> Status: 200 OK
|
||||
|
@ -469,7 +469,7 @@ User-Agent: Awesome-Octocat-App
|
|||
cURL sends a valid `User-Agent` header by default. If you provide an invalid `User-Agent` header via cURL (or via an alternative client), you will receive a `403 Forbidden` response:
|
||||
|
||||
```shell
|
||||
$ curl -iH 'User-Agent: ' {% data variables.product.api_url_pre %}/meta
|
||||
$ curl -IH 'User-Agent: ' {% data variables.product.api_url_pre %}/meta
|
||||
> HTTP/1.0 403 Forbidden
|
||||
> Connection: close
|
||||
> Content-Type: text/html
|
||||
|
@ -501,7 +501,7 @@ whenever possible.
|
|||
{% endif %}
|
||||
|
||||
```shell
|
||||
$ curl -i {% data variables.product.api_url_pre %}/user
|
||||
$ curl -I {% data variables.product.api_url_pre %}/user
|
||||
> HTTP/1.1 200 OK
|
||||
> Cache-Control: private, max-age=60
|
||||
> ETag: "644b5b0155e6404a9cc4bd9d8b1ae730"
|
||||
|
@ -512,7 +512,7 @@ $ curl -i {% data variables.product.api_url_pre %}/user
|
|||
> X-RateLimit-Remaining: 4996
|
||||
> X-RateLimit-Reset: 1372700873
|
||||
|
||||
$ curl -i {% data variables.product.api_url_pre %}/user -H 'If-None-Match: "644b5b0155e6404a9cc4bd9d8b1ae730"'
|
||||
$ curl -I {% data variables.product.api_url_pre %}/user -H 'If-None-Match: "644b5b0155e6404a9cc4bd9d8b1ae730"'
|
||||
> HTTP/1.1 304 Not Modified
|
||||
> Cache-Control: private, max-age=60
|
||||
> ETag: "644b5b0155e6404a9cc4bd9d8b1ae730"
|
||||
|
@ -523,7 +523,7 @@ $ curl -i {% data variables.product.api_url_pre %}/user -H 'If-None-Match: "644b
|
|||
> X-RateLimit-Remaining: 4996
|
||||
> X-RateLimit-Reset: 1372700873
|
||||
|
||||
$ curl -i {% data variables.product.api_url_pre %}/user -H "If-Modified-Since: Thu, 05 Jul 2012 15:31:30 GMT"
|
||||
$ curl -I {% data variables.product.api_url_pre %}/user -H "If-Modified-Since: Thu, 05 Jul 2012 15:31:30 GMT"
|
||||
> HTTP/1.1 304 Not Modified
|
||||
> Cache-Control: private, max-age=60
|
||||
> Last-Modified: Thu, 05 Jul 2012 15:31:30 GMT
|
||||
|
@ -546,7 +546,7 @@ Here's a sample request sent from a browser hitting
|
|||
`http://example.com`:
|
||||
|
||||
```shell
|
||||
$ curl -i {% data variables.product.api_url_pre %} -H "Origin: http://example.com"
|
||||
$ curl -I {% data variables.product.api_url_pre %} -H "Origin: http://example.com"
|
||||
HTTP/1.1 302 Found
|
||||
Access-Control-Allow-Origin: *
|
||||
Access-Control-Expose-Headers: ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
|
||||
|
@ -555,7 +555,7 @@ Access-Control-Expose-Headers: ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-Ra
|
|||
This is what the CORS preflight request looks like:
|
||||
|
||||
```shell
|
||||
$ curl -i {% data variables.product.api_url_pre %} -H "Origin: http://example.com" -X OPTIONS
|
||||
$ curl -I {% data variables.product.api_url_pre %} -H "Origin: http://example.com" -X OPTIONS
|
||||
HTTP/1.1 204 No Content
|
||||
Access-Control-Allow-Origin: *
|
||||
Access-Control-Allow-Headers: Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-GitHub-OTP, X-Requested-With
|
||||
|
|
Загрузка…
Ссылка в новой задаче