{"id":15893865,"url":"https://github.com/chinanf-boy/got-zh","last_synced_at":"2026-03-18T17:44:58.732Z","repository":{"id":90548387,"uuid":"157161078","full_name":"chinanf-boy/got-zh","owner":"chinanf-boy","description":"中文翻译: \u003cgot\u003e 简化的HTTP请求 :heart: 校对 ✅","archived":false,"fork":false,"pushed_at":"2019-03-29T04:57:15.000Z","size":59,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-20T10:36:54.339Z","etag":null,"topics":["docs","got","http","zh"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chinanf-boy.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-12T05:30:20.000Z","updated_at":"2023-04-17T07:15:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"f9d2097e-6120-484b-b8c1-99631ab9ee67","html_url":"https://github.com/chinanf-boy/got-zh","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chinanf-boy/got-zh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinanf-boy%2Fgot-zh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinanf-boy%2Fgot-zh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinanf-boy%2Fgot-zh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinanf-boy%2Fgot-zh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chinanf-boy","download_url":"https://codeload.github.com/chinanf-boy/got-zh/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinanf-boy%2Fgot-zh/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29549799,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T14:33:00.708Z","status":"ssl_error","status_checked_at":"2026-02-17T14:32:58.657Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docs","got","http","zh"],"created_at":"2024-10-06T08:13:57.097Z","updated_at":"2026-02-17T16:36:26.798Z","avatar_url":"https://github.com/chinanf-boy.png","language":null,"funding_links":["https://www.patreon.com/sindresorhus"],"categories":[],"sub_categories":[],"readme":"# sindresorhus/got [![explain]][source] [![translate-svg]][translate-list] \n    \n\u003c!-- [![size-img]][size] --\u003e\n\n[explain]: http://llever.com/explain.svg\n[source]: https://github.com/chinanf-boy/Source-Explain\n[translate-svg]: http://llever.com/translate.svg\n[translate-list]: https://github.com/chinanf-boy/chinese-translate-list\n[size-img]: https://packagephobia.now.sh/badge?p=Name\n[size]: https://packagephobia.now.sh/result?p=Name\n    \n\n\n「 简化的HTTP请求 」\n\n[中文](./readme.md) | [english](https://github.com/sindresorhus/got) \n\n\n---\n\n## 校对 ✅\n\n\u003c!-- doc-templite START generated --\u003e\n\u003c!-- repo = 'sindresorhus/got' --\u003e\n\u003c!-- commit = '7f18ef397341214d9f46d774f69e65d6cdd95494' --\u003e\n\u003c!-- time = '2018-11-08' --\u003e\n翻译的原文 | 与日期 | 最新更新 | 更多\n---|---|---|---\n[commit] | ⏰ 2018-11-08 | ![last] | [中文翻译][translate-list]\n\n[last]: https://img.shields.io/github/last-commit/sindresorhus/got.svg\n[commit]: https://github.com/sindresorhus/got/tree/7f18ef397341214d9f46d774f69e65d6cdd95494\n\n\u003c!-- doc-templite END generated --\u003e\n\n### 贡献\n\n欢迎 👏 勘误/校对/更新贡献 😊 [具体贡献请看](https://github.com/chinanf-boy/chinese-translate-list#贡献)\n        \n\n## 生活\n\n[If help, **buy** me coffee —— 营养跟不上了，给我来瓶营养快线吧! 💰](https://github.com/chinanf-boy/live-need-money)\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\t\u003cbr\u003e\n\t\u003cbr\u003e\n\t\u003cimg width=\"360\" src=\"https://github.com/sindresorhus/got/blob/master/media/logo.svg\" alt=\"Got\"\u003e\n\t\u003cbr\u003e\n\t\u003cbr\u003e\n\t\u003cbr\u003e\n\t\u003cp align=\"center\"\u003e非常感谢 \u003ca href=\"https://moxy.studio\"\u003e\u003cimg src=\"https://sindresorhus.com/assets/thanks/moxy-logo.svg\" width=\"150\"\u003e\u003c/a\u003e 赞助 me!\n\t\u003c/p\u003e\n\t\u003cbr\u003e\n\t\u003cbr\u003e\n\u003c/div\u003e\n\n\u003e 简化的HTTP请求\n\n[![Build Status: Linux](https://travis-ci.org/sindresorhus/got.svg?branch=master)](https://travis-ci.org/sindresorhus/got) [![Coverage Status](https://coveralls.io/repos/github/sindresorhus/got/badge.svg?branch=master)](https://coveralls.io/github/sindresorhus/got?branch=master) [![Downloads](https://img.shields.io/npm/dm/got.svg)](https://npmjs.com/got) [![Install size](https://packagephobia.now.sh/badge?p=got)](https://packagephobia.now.sh/result?p=got)\n\nGot是一个人性化,且功能强大的HTTP请求库.\n\n它的创建是因为常用的[`request`](https://github.com/request/request)包过臃肿: [![Install size](https://packagephobia.now.sh/badge?p=request)](https://packagephobia.now.sh/result?p=request)\n\nGot是Node.js的请求库。对于浏览器的请求,我们建议[ky](https://github.com/sindresorhus/ky).\n\n## Highlights\n\n-  [x] [Promise 和 Streams API](#api)\n-  [x] [请求取消](#aborting-the-request)\n-  [x] [符合RFC的缓存](#cache-adapters)\n-  [x] [遵循重定向](#followredirect)\n-  [x] [失败时重试](#retry)\n-  [x] [进展事件](#onuploadprogress-progress)\n-  [x] [处理 gzip/deflate](#decompress)\n-  [x] [超时处理](#timeout)\n-  [x] [元数据错误](#errors)\n-  [x] [JSON模式](#json)\n-  [x] [WHATWG URL支持](#url)\n-  [x] [钩子](https://github.com/sindresorhus/got#hooks)\n-  [x] [具有自定义默认值的实例](#instances)\n-  [x] [可组合](advanced-creation.zh.md#merging-instances)\n-  [x] [Electron支持](#useelectronnet)\n-  [由~2000包和~500K repos使用](https://github.com/sindresorhus/got/network/dependents)\n-   积极维护\n\n[了解Got,如何与其他HTTP库进行比较](#comparison)\n\n## Install\n\n```\n$ npm install got\n```\n\n\u003ca href=\"https://www.patreon.com/sindresorhus\"\u003e\n\t\u003cimg src=\"https://c5.patreon.com/external/logo/become_a_patron_button@2x.png\" width=\"160\"\u003e\n\u003c/a\u003e\n\n## Usage\n\n```js\nconst got = require('got');\n\n(async () =\u003e {\n\ttry {\n\t\tconst response = await got('sindresorhus.com');\n\t\tconsole.log(response.body);\n\t\t//=\u003e '\u003c!doctype html\u003e ...'\n\t} catch (error) {\n\t\tconsole.log(error.response.body);\n\t\t//=\u003e 'Internal server error ...'\n\t}\n})();\n```\n\n###### Streams\n\n```js\nconst fs = require('fs');\nconst got = require('got');\n\ngot.stream('sindresorhus.com').pipe(fs.createWriteStream('index.html'));\n\n// For POST, PUT, and PATCH methods `got.stream` returns a `stream.Writable`\nfs.createReadStream('index.html').pipe(got.stream.post('sindresorhus.com'));\n```\n\n### API\n\n`GET`方法为默认情况下的请求,但可以使用不同的方法，或在`options`.\n\n#### got(url, [options])\n\n\n- 返回一个[`response`对象](#response)的Promise或者\n\n- 一个[stream](#streams-1)，如果`options.stream`设置为true.\n\n\n参数 | \n---|\n[url](#url) |\n[options](#options) |\n\n##### url\n\n类型: | `string` `Object` \n---|---\n\n- 请求的URL，若是字符串, 一个[`https.request`选项对象](https://nodejs.org/api/https.html#https_https_request_options_callback)或者一个[WHATWG `URL`](https://nodejs.org/api/url.html#url_class_url).\n\n- `options`的属性将覆盖这个`url`属性.\n\n- 如果未指定协议,则默认为`https`.\n\n##### options\n\n类型: | `Object`\n---|---\n\n参数 |\u003e [Streams](#streams) / [baseUrl](#baseurl) / [headers](#headers) / [stream](#stream) / [body](#body) / [cookieJar](#cookiejar) / [encoding](#encoding) / [form](#form) / [json](#json) / [query](#query) / [timeout](#timeout) / [retry](#retry) / [followRedirect](#followredirect) / [decompress](#decompress) / [cache](#cache) / [request](#request) / [useElectronNet](#useelectronnet) / [throwHttpErrors](#throwhttperrors) / [agent](#agent) / [hooks](#hooks)\n\n任何一个[`https.request`](https://nodejs.org/api/https.html#https_https_request_options_callback)的选项.\n\n###### baseUrl\n\n类型:| `string` `Object`\n---|---\n\n- 指定时,`baseUrl`将作为`url`的前缀.\u003cbr\u003e如果您指定绝对URL,它将跳过`baseUrl`。\n\n使用`got.extend()`时非常有用，用于创建利基特定的Got实例.\n\n可以是字符串或[WHATWG `URL`](https://nodejs.org/api/url.html#url_class_url).\n\n削减`baseUrl`的结尾，拼接开始的`url`参数，且是可选的:\n\n```js\nawait got('hello', {baseUrl: 'https://example.com/v1'});\n//=\u003e 'https://example.com/v1/hello'\n\nawait got('/hello', {baseUrl: 'https://example.com/v1/'});\n//=\u003e 'https://example.com/v1/hello'\n\nawait got('/hello', {baseUrl: 'https://example.com/v1'});\n//=\u003e 'https://example.com/v1/hello'\n```\n\n###### headers\n\n类型:| `Object`\n---|---\n默认:|`{}`\n\n请求标头.\n\n- 现有标题将被覆盖。标题设置为`null`将被省略.\n\n###### stream\n\n类型:| `boolean`\n---|---\n默认:|`false`\n\n返回一个`Stream`，而不是`Promise`。这相当于调用`got.stream(url, [options])`.\n\n###### body\n\n类型:| `string` `Buffer` `stream.Readable` [`form-data`实例](https://github.com/form-data/form-data)\n---|---\n\n*如果您提供此选项,`got.stream()`将是只读的.*\n\n`POST`请求发送的主体.\n\n如果存在`options`和`options.method`未设定,`options.method`将被设置为`POST`.\n\n该`content-length`标题将自动设置，如果`body`是一个`string`/`Buffer`/`fs.createReadStream`实例/[`form-data`实例](https://github.com/form-data/form-data),和`content-length`和`transfer-encoding`就不再是`options.headers`的手动设置.\n\n###### cookieJar\n\n类型: | [`tough.CookieJar`实例](https://github.com/salesforce/tough-cookie#cookiejar)\n---|---\n\nCookie支持.您不必关心解析或如何存储它们.[例子.](#cookies)\n\n**注意:** `options.headers.cookie`将被覆盖.\n\n###### encoding\n\n类型:| `string` `null`\n---|---\n默认: | `'utf8'`\n\n[编码-Encoding](https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings)用于响应数据的`setEncoding`。如果`null`, 响应body会返回一个[`Buffer`](https://nodejs.org/api/buffer.html)(二进制数据).\n\n###### form\n\n类型:| `boolean`\n---|---\n默认: | `false`\n\n*如果您提供此选项,`got.stream()`将是只读的.*\n\n如果设置为`true`和`Content-Type`标头未设置,它将被设置为`application/x-www-form-urlencoded`.\n\n`body`必须是一个普通的对象。它将使用[`(new URLSearchParams(object)).toString()`](https://nodejs.org/api/url.html#url_constructor_new_urlsearchparams_obj)转换为查询字符串.\n\n###### json\n\n类型:| `boolean`\n---|---\n默认: | `false`\n\n*如果你使用`got.stream()`,此选项将被忽略.*\n\n如果设置为`true`和`Content-Type`标头未设置,它将被设置为`application/json`.\n\n用`JSON.parse`解析响应主体，并设置`accept`标题为`application/json`。如果与`form`选项一起使用,`body`将字符串化为查询字符串,并将响应解析为JSON.\n\n`body`必须是普通对象或数组,和能对其进行字符串化.\n\n###### query\n\n类型: | `string` `Object\u003cstring, string\\|number\u003e` [URLSearchParams](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams)\n---|---\n\n添加到请求URL的查询字符串。这将覆盖`url`的查询字符串.\n\n如果你需要传入一个数组,你可以使用一个`URLSearchParams`，例如:\n\n```js\nconst got = require('got');\n\nconst query = new URLSearchParams([['key', 'a'], ['key', 'b']]);\n\ngot('https://example.com', {query});\n\nconsole.log(query.toString());\n//=\u003e 'key=a\u0026key=b'\n```\n\n如果你需要一个不同的数组格式,你可以使用[`query-string`](https://github.com/sindresorhus/query-string)包:\n\n```js\nconst got = require('got');\nconst queryString = require('query-string');\n\nconst query = queryString.stringify({key: ['a', 'b']}, {arrayFormat: 'bracket'});\n\ngot('https://example.com', {query});\n\nconsole.log(query);\n//=\u003e 'key[]=a\u0026key[]=b'\n```\n\n###### timeout\n\n类型:| `number` `Object`\n---|---\n\n在中止请求发生[`got.TimeoutError`](#gottimeouterror)错误(a.k.a.`request`属性)之前，等待服务器结束响应的毫秒数。默认情况下,没有超时.\n\n这也会接受`object`，使用以下字段来约束请求生命周期的每个阶段的持续时间:\n\n-   `lookup`在分配套接字时启动,在解析主机名时结束。使用Unix域名套接字时不适用.\n-   `connect`从`lookup`完成开始(或如果lookup不适用于请求，分配套接字的时候)，并在连接套接字时结束.\n-   `secureConnect`从`connect`完成时开始，和在握手过程完成后结束(仅限HTTPS).\n-   `socket`在连接套接字时开始。看[request.setTimeout](https://nodejs.org/api/http.html#http_request_settimeout_timeout_callback).\n-   `response`当请求已写入套接字时开始,并在收到响应头时结束.\n-   `send`套接字连接时开始，并以请求结束写入套接字.\n-   `request`在请求初始化后开始,在响应的结束事件触发时结束.\n\n###### retry\n\n类型:| `number` `Object`\u003cbr\u003e\n---|---\n默认: | 重试:`2`次\n方法: | `GET` `PUT` `HEAD` `DELETE` `OPTIONS` `TRACE`\nstatusCodes: | [`408`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) [`413`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/413) [`429`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) [`500`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) [`502`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502) [`503`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503) [`504`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/504)\nmaxRetryAfter: | `undefined`\n\n- Object对象 : 代表\n\t- `retries`, 重试\n\t- `methods`, 允许的方法\n\t- `statusCodes`和 \n\t- `maxRetryAfter` 最大[`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After)时间。\n\n如果`maxRetryAfter`被设置为`undefined`,它会用`options.timeout`.\u003cbr\u003e如果[`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After)标头大于`maxRetryAfter`,它将取消请求.\n\n重试之间的延迟计算是`1000 * Math.pow(2, retry) + Math.random() * 100`函数,这里的`retry`是尝试数(从1开始).\n\n`retries`属性可以\n\n- 是`number`或者\n- 一个带`retry`和`error`参数的`function`.该函数必须以毫秒为单位的延迟返回(返回`0`值，会取消重试).\n\n**注意:**它仅在指定的方法,状态代码和这些网络错误上重试:\n\n-   `ETIMEDOUT`: 达到[超时](#timeout)其中一个限制.\n-   `ECONNRESET`:连接被网络点强行关闭.\n-   `EADDRINUSE`:无法绑定到任何自由端口.\n-   `ECONNREFUSED`:连接被服务器拒绝.\n-   `EPIPE`:正在写入的流的远程端已关闭.\n-   `ENOTFOUND`:无法将主机名解析为IP地址.\n-   `ENETUNREACH`: 没有网络连接.\n-   `EAI_AGAIN`:DNS查找超时.\n\n###### followRedirect\n\n类型:| `boolean`\n---|---\n默认:|`true`\n\n定义是否应自动遵循重定向响应.\n\n请注意,如果服务器发送回来一个`303`，以响应任何请求类型(`POST`,`DELETE`等等),Got会自动通过`GET`请求，位置头中指向的资源。这符合[规范](https://tools.ietf.org/html/rfc7231#section-6.4.4).\n\n###### decompress\n\n类型:| `boolean`\n---|---\n默认:|`true`\n\n自动解压响应。这将设置`accept-encoding`标题为`gzip, deflate`，除非你自己设定.\n\n如果禁用此选项,则会将压缩响应作为一个`Buffer`返回。如果您想自己处理解压或stream式处理原始压缩数据, 这可能很有用.\n\n###### cache\n\n类型:| `Object`\n---|---\n默认:|`false`\n\n[缓存适配器实例](#cache-adapters)用于存储缓存的数据.\n\n###### request\n\n类型:| `Function`\u003cbr\u003e\n---|---\n默认: | `http.request` `https.request` *(取决于协议)*\n\n自定义请求函数.这样做的主要目的是为了[通过包装HTTP2，以此支持这个协议](#experimental-http2-support).\n\n###### useElectronNet\n\n类型:| `boolean`\n---|---\n默认:|`false`\n\n在Electron中使用时,Got会使用[`electron.net`](https://electronjs.org/docs/api/net/)替代Node.js`http`模块。根据Electron的文档,它应该是完全兼容的,但其实不是完全兼容.看到[#443](https://github.com/sindresorhus/got/issues/443)和[#461](https://github.com/sindresorhus/got/issues/461).\n\n###### throwHttpErrors\n\n类型:| `boolean`\n---|---\n默认:|`true`\n\n确定是否抛出`got.HTTPError`错误响应(非2xx状态代码).\n\n如果禁用此选项,在请求遇到错误状态代码，会使用`response` resolve，而不是抛出`got.HTTPError`。如果您正在检查资源可用性,并且期望出现错误响应,这可能很有用.\n\n###### agent\n\n对应`http.request`的[`agent`选项](https://nodejs.org/api/http.html#http_http_request_url_options_callback),但有一个额外的功能:\n\n如果您需要针对不同协议的不同代理,则可以将代理映射传递给`agent`选项。这是必要的,因为对一个协议的请求可能会重定向到另一个协议。在这种情况下,Got将为您切换到正确的协议代理.\n\n```js\nconst got = require('got');\nconst HttpAgent = require('agentkeepalive');\nconst {HttpsAgent} = HttpAgent;\n\ngot('sindresorhus.com', {\n\tagent: {\n\t\thttp: new HttpAgent(),\n\t\thttps: new HttpsAgent()\n\t}\n});\n```\n\n###### hooks\n\n类型:| `Object\u003cstring, Function[]\u003e`\n---|---\n\n钩子允许在请求生命周期中进行修改。钩子函数可以是异步的，和也能串行运行的.\n\n###### hooks.beforeRequest\n\n类型:| `Function[]`\n---|---\n默认:|`[]`\n\n调用[标准的](source/normalize-arguments.js) [请求选项](#options)。在发送请求之前,不会对请求进行进一步更改。这对结合[`got.extend()`](#instances)和[`got.create()`](advanced-creation.zh.md)使用，特别有用，当您想要创建一个API客户端时,例如,使用HMAC签名.\n\n见[AWS部分](#aws)举的例子.\n\n**注意**:如果你修改了`body`，你也需要修改`content-length`标题,因为它已经被计算和分配.\n\n###### hooks.beforeRedirect\n\n类型:| `Function[]`\n---|---\n默认:|`[]`\n\n调用[标准的](source/normalize-arguments.js) [请求选项](#options)。Got的请求不会进一步更改.当您想要避免死站点时,这尤其有用.例:\n\n```js\nconst got = require('got');\n\ngot('example.com', {\n\thooks: {\n\t\tbeforeRedirect: [\n\t\t\toptions =\u003e {\n\t\t\t\tif (options.hostname === 'deadSite') {\n\t\t\t\t\toptions.hostname = 'fallbackSite';\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t}\n});\n```\n\n###### hooks.beforeRetry\n\n类型:| `Function[]`\n---|---\n默认:|`[]`\n\n调用[标准的](source/normalize-arguments.js) [请求选项](#options),错误和重试计数。Got的请求不会进一步更改。在下次尝试之前，需要一些额外的工作时,这尤其有用.例:\n\n```js\nconst got = require('got');\n\ngot('example.com', {\n\thooks: {\n\t\tbeforeRetry: [\n\t\t\t(options, error, retryCount) =\u003e {\n\t\t\t\tif (error.statusCode === 413) { // Payload too large\n\t\t\t\t\toptions.body = getNewBody();\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t}\n});\n```\n\n###### hooks.afterResponse\n\n类型:| `Function[]`\n---|---\n默认:|`[]`\n\n调用[响应对象](#response)和重试函数.\n\n每个函数都应该返回响应。当您想要刷新访问令牌时,这尤其有用.例:\n\n```js\nconst got = require('got');\n\nconst instance = got.extend({\n\thooks: {\n\t\tafterResponse: [\n\t\t\t(response, retryWithMergedOptions) =\u003e {\n\t\t\t\tif (response.statusCode === 401) { // Unauthorized\n\t\t\t\t\tconst updatedOptions = {\n\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\ttoken: getNewToken() // Refresh the access token\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\t// Save for further requests\n\t\t\t\t\tinstance.defaults.options = got.mergeOptions(instance.defaults.options, updatedOptions);\n\n\t\t\t\t\t// Make a new retry\n\t\t\t\t\treturn retryWithMergedOptions(updatedOptions);\n\t\t\t\t}\n\n\t\t\t\t// No changes otherwise\n\t\t\t\treturn response;\n\t\t\t}\n\t\t]\n\t},\n\tmutableDefaults: true\n});\n```\n\n#### Response\n\n响应对象通常是一个[Node.js HTTP响应流](https://nodejs.org/api/http.html#http_class_http_incomingmessage)但是,如果从缓存返回，那它会是一个[类似响应的对象](https://github.com/lukechilds/responselike)和行为方式相同.\n\n**参数** |\u003e [body](#body-1) /  [url](#url-1) /  [requestUrl](#requesturl) /  [timings](#timings) /  [fromCache](#fromcache) /  [redirectUrls](#redirecturls) /  [retryCount](#retrycount) / \n\n\n\n##### body\n\n类型:| `string` `Object` *(取决于`options.json`)*\n---|---\n\n请求的结果.\n\n##### url\n\n类型:| `string`\n---|---\n\n重定向后的请求URL或最终URL.\n\n##### requestUrl\n\n类型:| `string`\n---|---\n\n原始请求网址.\n\n##### timings\n\n类型:| `Object`\n---|---\n\n该对象包含以下属性:\n\n-   `start`- 请求开始的时间.\n-   `socket`- 将套接字分配给请求的时间.\n-   `lookup`-  DNS查找完成的时间.\n-   `connect`- 套接字成功连接的时间.\n-   `upload`- 请求完成上传的时间.\n-   `response`- 请求解雇的时间`response`事件.\n-   `end`- 响应解雇的时间`end`事件.\n-   `error`- 请求解雇的时间`error`事件.\n-   `phases` \t\t- `wait` - `timings.socket - timings.start` \t\t- `dns` - `timings.lookup - timings.socket` \t\t- `tcp` - `timings.connect - timings.lookup` \t\t- `request` - `timings.upload - timings.connect` \t\t- `firstByte` - `timings.response - timings.upload` \t\t- `download` - `timings.end - timings.response`-`total`-`timings.end - timings.start`要么`timings.error - timings.start`\n\n**注意**:时间是`number`表示自UNIX纪元以来经过的毫秒数.\n\n##### fromCache\n\n类型:| `boolean`\n---|---\n\n是否从缓存中检索响应.\n\n##### redirectUrls\n\n类型:| `Array`\n---|---\n\n重定向网址.\n\n##### retryCount\n\n类型:| `number`\n---|---\n\n重试请求的次数.\n\n#### Streams\n\n**注意**:进度事件,重定向事件和请求/响应事件，也可以与promise一起使用.\n\n#### got.stream(url, [options])\n\n设`options.stream`为`true`.\n\n返回带有其他活动的一个[双工流](https://nodejs.org/api/stream.html#stream_class_stream_duplex):\n\n##### .on('request', request)\n\n`request`事件获取请求的request对象.\n\n**小费**: 您可以使用`request`事件,中止请求:\n\n```js\ngot.stream('github.com')\n\t.on('request', request =\u003e setTimeout(() =\u003e request.abort(), 50));\n```\n\n##### .on('response', response)\n\n`response`事件获取最终请求的response对象.\n\n##### .on('redirect', response, nextOptions)\n\n`redirect`事件获取重定向的response对象。第二个参数是下一个重定向位置请求的选项.\n\n##### .on('uploadProgress', progress)\n\n##### .on('downloadProgress', progress)\n\n上传(发送请求)和下载(接收响应)的进度事件。该`progress`参数是一个像这样的对象:\n\n```js\n{\n\tpercent: 0.1,\n\ttransferred: 1024,\n\ttotal: 10240\n}\n```\n\n如果无法检索大小(流式传输时，可能发生),`total`会是`null`.\n\n```js\n(async () =\u003e {\n\tconst response = await got('sindresorhus.com')\n\t\t.on('downloadProgress', progress =\u003e {\n\t\t\t// Report download progress\n\t\t})\n\t\t.on('uploadProgress', progress =\u003e {\n\t\t\t// Report upload progress\n\t\t});\n\n\tconsole.log(response);\n})();\n```\n\n##### .on('error', error, body, response)\n\n`error`在协议错误的情况下，发出的事件(如`ENOTFOUND`等)或状态错误(4xx或5xx)。第二个参数是状态错误时服务器响应的主体。第三个参数是响应对象.\n\n#### got.get(url, [options])\n\n#### got.post(url, [options])\n\n#### got.put(url, [options])\n\n#### got.patch(url, [options])\n\n#### got.head(url, [options])\n\n#### got.delete(url, [options])\n\n将`options.method`方法名称设置好，和做成请求.\n\n### Instances\n\n#### got.extend([options])\n\n配置一个带默认`options`的新`got`实例。该`options`与父实例的`defaults.options`合并，合并是通过使用[`got.mergeOptions`](#gotmergeoptionsparentoptions-newoptions)。您可以使用在实例上的`.defaults`属性，访问已resolve的选项,.\n\n```js\nconst client = got.extend({\n\tbaseUrl: 'https://example.com',\n\theaders: {\n\t\t'x-unicorn': 'rainbow'\n\t}\n});\n\nclient.get('/demo');\n\n/* HTTP Request =\u003e\n * GET /demo HTTP/1.1\n * Host: example.com\n * x-unicorn: rainbow\n */\n```\n\n```js\n(async () =\u003e {\n\tconst client = got.extend({\n\t\tbaseUrl: 'httpbin.org',\n\t\theaders: {\n\t\t\t'x-foo': 'bar'\n\t\t}\n\t});\n\tconst {headers} = (await client.get('/headers', {json: true})).body;\n\t//=\u003e headers['x-foo'] === 'bar'\n\n\tconst jsonClient = client.extend({\n\t\tjson: true,\n\t\theaders: {\n\t\t\t'x-baz': 'qux'\n\t\t}\n\t});\n\tconst {headers: headers2} = (await jsonClient.get('/headers')).body;\n\t//=\u003e headers2['x-foo'] === 'bar'\n\t//=\u003e headers2['x-baz'] === 'qux'\n})();\n```\n\n*需要更多控制Got的行为? 看看[`got.create()`](advanced-creation.zh.md).*\n\n#### got.mergeOptions(parentOptions, newOptions)\n\n扩展父选项。避免使用[对象传播...](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax#Spread_in_object_literals)，因为它不能递归工作:\n\n```js\nconst a = {headers: {cat: 'meow', wolf: ['bark', 'wrrr']}};\nconst b = {headers: {cow: 'moo', wolf: ['auuu']}};\n\n{...a, ...b}            // =\u003e {headers: {cow: 'moo', wolf: ['auuu']}}\ngot.mergeOptions(a, b)  // =\u003e {headers: {cat: 'meow', cow: 'moo', wolf: ['auuu']}}\n```\n\n\u003c!-- HERE --\u003e\n\nOptions会深度合并到新对象。每个字段名的确定步骤如下: \n\n\u003e `a`为旧/父的，`b`为新的。\n\n-   如果新属性设置为`undefined`，保留了旧的.\n-   如果父属性是`URL`的实例，而新的值是`string`或者`URL`, 那就创建一个新的URL实例:[`new URL(new, parent)`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL#Syntax).\n-   如果新属性是普通`Object`: \n\t- 如果父属性也是普通的`Object`, 那两个值递归合并为一个新的`Object`.\n\t- 否则,只会深拷贝新值.\n-   如果新属性是`Array`,它用新属性的深拷贝覆盖旧的.\n-   否则,新值分配给对应的字段就好了。\n\n#### got.defaults\n\n类型:| `Object`\n---|---\n\n默认的Got选项.\n\n## Errors\n\n每个错误包含(如果可用)的属性字段 |\n---|\n`body`,|\n`statusCode`,|\n`statusMessage`,|\n`host`,|\n`hostname`|\n`method`,|\n`path`,|\n`protocol`|\n`url`|\n\n使调试更容易.\n\n在Promise模式下,\n`response`也附加到错误.\n\n#### got.CacheError\n\n例如,当缓存方法失败时,如果数据库出现故障或存在文件系统错误.\n\n#### got.RequestError\n\n请求失败时，包含一个具有错误类代码的`code`属性,如`ECONNREFUSED`.\n\n#### got.ReadError\n\n从响应流中读取失败.\n\n#### got.ParseError\n\n当`json`选项已启用,服务器响应代码为2xx,和`JSON.parse`失败.\n\n#### got.HTTPError\n\n当服务器响应代码不是2xx时，包括`statusCode`,`statusMessage`,和`redirectUrls`属性.\n\n#### got.MaxRedirectsError\n\n当服务器重定向您十次以上时，包括一个`redirectUrls`属性,这是在放弃之前，重定向的一个URL数组.\n\n#### got.UnsupportedProtocolError\n\n不支持的协议时.\n\n#### got.CancelError\n\n请求被`.cancel()`中止时.\n\n#### got.TimeoutError\n\n当请求因一个[超时](#timeout)而中止时\n\n## Aborting the request\n\nGot返回的Promise有一个[`.cancel()`](https://github.com/sindresorhus/p-cancelable)。当调用时,会中止请求.\n\n```js\n(async () =\u003e {\n\tconst request = got(url, options);\n\n\t// …\n\n\t// In another part of the code\n\tif (something) {\n\t\trequest.cancel();\n\t}\n\n\t// …\n\n\ttry {\n\t\tawait request;\n\t} catch (error) {\n\t\tif (request.isCanceled) { // Or `error instanceof got.CancelError`\n\t\t\t// Handle cancelation\n\t\t}\n\n\t\t// Handle other errors\n\t}\n})();\n```\n\n\u003ca name=\"cache-adapters\"\u003e\u003c/a\u003e\n\n## Cache\n\nGot实现了[RFC 7234](http://httpwg.org/specs/rfc7234.html)兼容的HTTP缓存,可以在内存中开箱即用,并且可以使用各种存储适配器轻松插入。直接从缓存提供新缓存项,并使用`If-None-Match`/`If-Modified-Since`头重新验证过时的缓存项。您可以在[`cacheable-request`文件](https://github.com/lukechilds/cacheable-request)中，阅读有关基本缓存行为的更多信息.\n\n您可以使用JavaScript`Map`类型，作为内存缓存:\n\n```js\nconst got = require('got');\nconst map = new Map();\n\n(async () =\u003e {\n\t\tlet response = await got('sindresorhus.com', {cache: map});\n\t\tconsole.log(response.fromCache);\n\t\t//=\u003e false\n\n\t\tresponse = await got('sindresorhus.com', {cache: map});\n\t\tconsole.log(response.fromCache);\n\t\t//=\u003e true\n})();\n```\n\nGot 内部使用[Keyv](https://github.com/lukechilds/keyv)支持各种存储适配器。对于更多伸缩性,你可以使用[官方Keyv存储适配器](https://github.com/lukechilds/keyv#official-storage-adapters):\n\n```\n$ npm install @keyv/redis\n```\n\n```js\nconst got = require('got');\nconst KeyvRedis = require('@keyv/redis');\n\nconst redis = new KeyvRedis('redis://user:pass@localhost:6379');\n\ngot('sindresorhus.com', {cache: redis});\n```\n\nGot提供了Map API内容的支持,因此可以轻松编写自己的存储适配器或使用第三方解决方案.\n\n例如,以下所有，都是有效的存储适配器:\n\n```js\nconst storageAdapter = new Map();\n// Or\nconst storageAdapter = require('./my-storage-adapter');\n// Or\nconst QuickLRU = require('quick-lru');\nconst storageAdapter = new QuickLRU({maxSize: 1000});\n\ngot('sindresorhus.com', {cache: storageAdapter});\n```\n\n查看[keyv文档](https://github.com/lukechilds/keyv)有关如何使用存储适配器的更多信息.\n\n## Proxies\n\n你可以使用[`tunnel`](https://github.com/koichik/node-tunnel)包,加上`agent`与代理一起工作:\n\n```js\nconst got = require('got');\nconst tunnel = require('tunnel');\n\ngot('sindresorhus.com', {\n\tagent: tunnel.httpOverHttp({\n\t\tproxy: {\n\t\t\thost: 'localhost'\n\t\t}\n\t})\n});\n```\n\n查看下[`global-tunnel`](https://github.com/np-maintain/global-tunnel)，如果您想为应用程序中的所有HTTP/HTTPS流量配置代理支持.\n\n## Cookies\n\n你可以使用[`tough-cookie`](https://github.com/salesforce/tough-cookie)包:\n\n```js\nconst got = require('got');\nconst {CookieJar} = require('tough-cookie');\n\nconst cookieJar = new CookieJar();\ncookieJar.setCookie('foo=bar', 'https://www.google.com');\n\ngot('google.com', {cookieJar});\n```\n\n## Form data\n\n你可以使用[`form-data`](https://github.com/form-data/form-data)，用表单数据创建POST请求:\n\n```js\nconst fs = require('fs');\nconst got = require('got');\nconst FormData = require('form-data');\nconst form = new FormData();\n\nform.append('my_file', fs.createReadStream('/foo/bar.jpg'));\n\ngot.post('google.com', {\n\tbody: form\n});\n```\n\n## OAuth\n\n你可以使用[`oauth-1.0a`](https://github.com/ddo/oauth-1.0a)包，创建签名的OAuth请求:\n\n```js\nconst got = require('got');\nconst crypto  = require('crypto');\nconst OAuth = require('oauth-1.0a');\n\nconst oauth = OAuth({\n\tconsumer: {\n\t\tkey: process.env.CONSUMER_KEY,\n\t\tsecret: process.env.CONSUMER_SECRET\n\t},\n\tsignature_method: 'HMAC-SHA1',\n\thash_function: (baseString, key) =\u003e crypto.createHmac('sha1', key).update(baseString).digest('base64')\n});\n\nconst token = {\n\tkey: process.env.ACCESS_TOKEN,\n\tsecret: process.env.ACCESS_TOKEN_SECRET\n};\n\nconst url = 'https://api.twitter.com/1.1/statuses/home_timeline.json';\n\ngot(url, {\n\theaders: oauth.toHeader(oauth.authorize({url, method: 'GET'}, token)),\n\tjson: true\n});\n```\n\n## Unix Domain Sockets\n\n请求也可以通过[UNIX域名套接字](http://serverfault.com/questions/124517/whats-the-difference-between-unix-socket-and-tcp-ip-socket)发送出去。 使用以下URL方案:`PROTOCOL://unix:SOCKET:PATH`.\n\n-   `PROTOCOL` - `http`或`https` *(可选)*\n-   `SOCKET`- 一个UNIX域名套接字的绝对路径,例如:`/var/run/docker.sock`\n-   `PATH`- 请求路径,例如:`/v2/keys`\n\n```js\ngot('http://unix:/var/run/docker.sock:/containers/json');\n\n// Or without protocol (HTTP by default)\ngot('unix:/var/run/docker.sock:/containers/json');\n```\n\n## AWS\n\n对AWS服务的请求，需要签署他们的标头(headers)。这可以通过使用[`aws4`](https://www.npmjs.com/package/aws4)包。这是一个用已签名的请求，查询[\"API网关\"](https://docs.aws.amazon.com/apigateway/api-reference/signing-requests/)的示例..\n\n```js\nconst AWS = require('aws-sdk');\nconst aws4 = require('aws4');\nconst got = require('got');\n\nconst chain = new AWS.CredentialProviderChain();\n\n// Create a Got instance to use relative paths and signed requests\nconst awsClient = got.extend({\n\tbaseUrl: 'https://\u003capi-id\u003e.execute-api.\u003capi-region\u003e.amazonaws.com/\u003cstage\u003e/',\n\thooks: {\n\t\tbeforeRequest: [\n\t\t\tasync options =\u003e {\n\t\t\t\tconst credentials = await chain.resolvePromise();\n\t\t\t\taws4.sign(options, credentials);\n\t\t\t}\n\t\t]\n\t}\n});\n\nconst response = await awsClient('endpoint/path', {\n\t// Request-specific options\n});\n```\n\n## Testing\n\n您可以通过使用[`nock`](https://github.com/node-nock/nock)包模拟端点:\n\n```js\nconst got = require('got');\nconst nock = require('nock');\n\nnock('https://sindresorhus.com')\n\t.get('/')\n\t.reply(200, 'Hello world!');\n\n(async () =\u003e {\n\tconst response = await got('sindresorhus.com');\n\tconsole.log(response.body);\n\t//=\u003e 'Hello world!'\n})();\n```\n\n如果需要真正的集成测试,可以使用[`create-test-server`](https://github.com/lukechilds/create-test-server):\n\n```js\nconst got = require('got');\nconst createTestServer = require('create-test-server');\n\n(async () =\u003e {\n\tconst server = await createTestServer();\n\tserver.get('/', 'Hello world!');\n\n\tconst response = await got(server.url);\n\tconsole.log(response.body);\n\t//=\u003e 'Hello world!'\n\n\tawait server.close();\n})();\n```\n\n## Tips\n\n### User Agent\n\n设置`'user-agent'`头是个好主意，因此提供者可以更容易地看到它们的资源是如何使用的。默认情况下,它是指向这个存储库的URL。当然您也可以设置为`null`禁用.\n\n```js\nconst got = require('got');\nconst pkg = require('./package.json');\n\ngot('sindresorhus.com', {\n\theaders: {\n\t\t'user-agent': `my-package/${pkg.version} (https://github.com/username/my-package)`\n\t}\n});\n\ngot('sindresorhus.com', {\n\theaders: {\n\t\t'user-agent': null\n\t}\n});\n```\n\n### 304 Responses\n\n记住,如果你发送一个`if-modified-since`标题。和接收到了`304 Not Modified`响应,主体-body就会是空的。缓存和检索主体内容是您的职责.\n\n### Custom endpoints\n\n使用`got.extend()`让它更好地与REST API一起工作。特别是你使用了`baseUrl`选项.\n\n**注:**不要对[`got.create()`](advanced-creation.zh.md)感到疑惑,它没有默认值.\n\n```js\nconst got = require('got');\nconst pkg = require('./package.json');\n\nconst custom = got.extend({\n\tbaseUrl: 'example.com',\n\tjson: true,\n\theaders: {\n\t\t'user-agent': `my-package/${pkg.version} (https://github.com/username/my-package)`\n\t}\n});\n\n// Use `custom` exactly how you use `got`\n(async () =\u003e {\n\tconst list = await custom('/v1/users/list');\n})();\n```\n\n*需要将一些实例合并为单个实例吗? 查看[`got.mergeInstances()`](advanced-creation.zh.md#merging-instances).*\n\n### Experimental HTTP2 support\n\nGET提供了[`http2-wrapper`](https://github.com/szmarczak/http2-wrapper)包，使用HTTP2的实验支持:\n\n```js\nconst got = require('got');\nconst {request} = require('http2-wrapper');\n\nconst h2got = got.extend({request});\n\n(async () =\u003e {\n\tconst {body} = await h2got('https://nghttp2.org/httpbin/headers');\n\tconsole.log(body);\n})();\n```\n\n## Comparison\n\n|                       |     `got`    |   `request`  | `node-fetch` |    `axios`   |\n|-----------------------|:------------:|:------------:|:------------:|:------------:|\n| HTTP/2 支持        |      ❔      |       ✖      |       ✖      |       ✖      |\n| Browser 支持       |       ✖      |       ✖      |       ✔*     |       ✔      |\n| Electron 支持      |       ✔      |       ✖      |       ✖      |       ✖      |\n| Promise API           |       ✔      |       ✔      |       ✔      |       ✔      |\n| Stream API            |       ✔      |       ✔      | Node.js only |       ✖      |\n| Request 中止   |       ✔      |       ✖      |       ✖      |       ✔      |\n| RFC compliant caching |       ✔      |       ✖      |       ✖      |       ✖      |\n| Cookies (out-of-box)  |       ✔      |       ✔      |       ✖      |       ✖      |\n| 跟踪 重定向网址     |       ✔      |       ✔      |       ✔      |       ✔      |\n| 失败重试   |       ✔      |       ✖      |       ✖      |       ✖      |\n| Progress 事件       |       ✔      |       ✖      |       ✖      | Browser only |\n| 可控 gzip/deflate  |       ✔      |       ✔      |       ✔      |       ✔      |\n| timeouts  优化   |       ✔      |       ✖      |       ✖      |       ✖      |\n| Timings               |       ✔      |       ✔      |       ✖      |       ✖      |\n| Errors 元数据  |       ✔      |       ✖      |       ✖      |       ✔      |\n| JSON 模式             |       ✔      |       ✔      |       ✖      |       ✔      |\n| Custom defaults       |       ✔      |       ✔      |       ✖      |       ✔      |\n| Composable            |       ✔      |       ✖      |       ✖      |       ✖      |\n| Hooks                 |       ✔      |       ✖      |       ✖      |       ✔      |\n| Issues open           |   ![][gio]   |   ![][rio]   |   ![][nio]   |   ![][aio]   |\n| Issues closed         |   ![][gic]   |   ![][ric]   |   ![][nic]   |   ![][aic]   |\n| Downloads             |    ![][gd]   |    ![][rd]   |    ![][nd]   |    ![][ad]   |\n| Coverage              |    ![][gc]   |    ![][rc]   |    ![][nc]   |    ![][ac]   |\n| Build                 |    ![][gb]   |    ![][rb]   |    ![][nb]   |    ![][ab]   |\n| Bugs                  |   ![][gbg]   |   ![][rbg]   |   ![][nbg]   |   ![][abg]   |\n| Dependents            |   ![][gdp]   |   ![][rdp]   |   ![][ndp]   |   ![][adp]   |\n| Install size          |   ![][gis]   |   ![][ris]   |   ![][nis]   |   ![][ais]   |\n\n\\*它几乎与浏览器`fetch` API兼容.\u003cbr\u003e ❔ 实验支持.\n\n\u003c!-- ISSUES OPEN --\u003e\n\n[gio]: https://img.shields.io/github/issues/sindresorhus/got.svg\n\n[rio]: https://img.shields.io/github/issues/request/request.svg\n\n[nio]: https://img.shields.io/github/issues/bitinn/node-fetch.svg\n\n[aio]: https://img.shields.io/github/issues/axios/axios.svg\n\n\u003c!-- ISSUES CLOSED --\u003e\n\n[gic]: https://img.shields.io/github/issues-closed/sindresorhus/got.svg\n\n[ric]: https://img.shields.io/github/issues-closed/request/request.svg\n\n[nic]: https://img.shields.io/github/issues-closed/bitinn/node-fetch.svg\n\n[aic]: https://img.shields.io/github/issues-closed/axios/axios.svg\n\n\u003c!-- DOWNLOADS --\u003e\n\n[gd]: https://img.shields.io/npm/dm/got.svg\n\n[rd]: https://img.shields.io/npm/dm/request.svg\n\n[nd]: https://img.shields.io/npm/dm/node-fetch.svg\n\n[ad]: https://img.shields.io/npm/dm/axios.svg\n\n\u003c!-- COVERAGE --\u003e\n\n[gc]: https://coveralls.io/repos/github/sindresorhus/got/badge.svg?branch=master\n\n[rc]: https://coveralls.io/repos/github/request/request/badge.svg?branch=master\n\n[nc]: https://coveralls.io/repos/github/bitinn/node-fetch/badge.svg?branch=master\n\n[ac]: https://coveralls.io/repos/github/mzabriskie/axios/badge.svg?branch=master\n\n\u003c!-- BUILD --\u003e\n\n[gb]: https://travis-ci.org/sindresorhus/got.svg?branch=master\n\n[rb]: https://travis-ci.org/request/request.svg?branch=master\n\n[nb]: https://travis-ci.org/bitinn/node-fetch.svg?branch=master\n\n[ab]: https://travis-ci.org/axios/axios.svg?branch=master\n\n\u003c!-- BUGS --\u003e\n\n[gbg]: https://badgen.net/github/label-issues/sindresorhus/got/bug/open\n\n[rbg]: https://badgen.net/github/label-issues/request/request/Needs%20investigation/open\n\n[nbg]: https://badgen.net/github/label-issues/bitinn/node-fetch/bug/open\n\n[abg]: https://badgen.net/github/label-issues/axios/axios/bug/open\n\n\u003c!-- DEPENDENTS --\u003e\n\n[gdp]: https://badgen.net/npm/dependents/got\n\n[rdp]: https://badgen.net/npm/dependents/request\n\n[ndp]: https://badgen.net/npm/dependents/node-fetch\n\n[adp]: https://badgen.net/npm/dependents/axios\n\n\u003c!-- INSTALL SIZE --\u003e\n\n[gis]: https://packagephobia.now.sh/badge?p=got\n\n[ris]: https://packagephobia.now.sh/badge?p=request\n\n[nis]: https://packagephobia.now.sh/badge?p=node-fetch\n\n[ais]: https://packagephobia.now.sh/badge?p=axios\n\n## Related\n\n- [gh-got](https://github.com/sindresorhus/gh-got) - Got 便利包，与GitHub API交互\n- [gl-got](https://github.com/singapore/gl-got) - Got 便利包，与Gitlab API交互\n- [travis-got](https://github.com/samverschueren/travis-got) - Got 便利包，与Travis API交互\n- [graphql-got](https://github.com/kevva/graphql-got) - Got 便利包，与GraphQL API交互\n- [GotQL](https://github.com/khaosdoctor/gotql) - Got 便利包，与GraphQL API交互, 但是使用JSON解析替代字符串\n\n## Maintainers\n\n| [![Sindre Sorhus](https://github.com/sindresorhus.png?size=100)](https://sindresorhus.com) | [![Vsevolod Strukchinsky](https://github.com/floatdrop.png?size=100)](https://github.com/floatdrop) | [![Alexander Tesfamichael](https://github.com/AlexTes.png?size=100)](https://github.com/AlexTes) | [![Luke Childs](https://github.com/lukechilds.png?size=100)](https://github.com/lukechilds) | [![Szymon Marczak](https://github.com/szmarczak.png?size=100)](https://github.com/szmarczak) | [![Brandon Smith](https://github.com/brandon93s.png?size=100)](https://github.com/brandon93s) |\n| ------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |\n| [Sindre Sorhus](https://sindresorhus.com) | [Vsevolod Strukchinsky](https://github.com/floatdrop) | [Alexander Tesfamichael](https://alextes.me) | [Luke Childs](https://github.com/lukechilds) | [Szymon Marczak](https://github.com/szmarczak) | [Brandon Smith](https://github.com/brandon93s) |\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchinanf-boy%2Fgot-zh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchinanf-boy%2Fgot-zh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchinanf-boy%2Fgot-zh/lists"}