• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

sindresorhus/got:

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

sindresorhus/got

开源软件地址:

https://github.com/sindresorhus/got

开源编程语言:

TypeScript 100.0%

开源软件介绍:



Got


Sindre's open source work is supported by the community.
Special thanks to:




Strapi
Strapi is the leading open-source headless CMS.
It’s 100% JavaScript, fully customizable, and developer-first.


Find the cheapest way to send money abroad



Keygen
A dead-simple software licensing and distribution API built for developers



neverinstall

All your favourite IDE's now available on the cloud
Neverinstall gives you an uninterrupted development experience and improved accessibility,
allowing you to code faster, better and on-the-go on your favourite IDEs like
Android Studio, VS Code, Jupyter and PyCharm using your browser.
neverinstall

All your favourite IDE's now available on the cloud
Neverinstall gives you an uninterrupted development experience and improved accessibility,
allowing you to code faster, better and on-the-go on your favourite IDEs like
Android Studio, VS Code, Jupyter and PyCharm using your browser.



Anvil

Paperwork that makes the data work.
Easy APIs for paperwork. PDF generation, e-signature and embeddable no-code webforms.
The easiest way to build paperwork automation into your product.
Anvil

Paperwork that makes the data work.
Easy APIs for paperwork. PDF generation, e-signature and embeddable no-code webforms.
The easiest way to build paperwork automation into your product.






Human-friendly and powerful HTTP request library for Node.js

Downloads Install size

See how Got compares to other HTTP libraries


For browser usage, we recommend Ky by the same people.


Support questions should be asked here.

Install

npm install got

Warning: This package is native ESM and no longer provides a CommonJS export. If your project uses CommonJS, you'll have to convert to ESM or use the dynamic import() function. Please don't open issues for questions regarding CommonJS / ESM. You can also use Got v11 instead which is pretty stable.

Take a peek

JSON mode

Got has a dedicated option for handling JSON payload.
Furthermore, the promise exposes a .json<T>() function that returns Promise<T>.

import got from 'got';

const {data} = await got.post('https://httpbin.org/anything', {
	json: {
		hello: 'world'
	}
}).json();

console.log(data);
//=> {"hello": "world"}

For advanced JSON usage, check out the parseJson and stringifyJson options.

For more useful tips like this, visit the Tips page.

Highlights

Documentation

Main API

Timeouts and retries

Advanced creation

Cache, Proxy and UNIX sockets

Integration


Migration guides

Got plugins

  • got4aws - Got convenience wrapper to interact with AWS v4 signed APIs
  • gh-got - Got convenience wrapper to interact with the GitHub API
  • gl-got - Got convenience wrapper to interact with the GitLab API
  • gotql - Got convenience wrapper to interact with GraphQL using JSON-parsed queries instead of strings
  • got-fetch - Got with a fetch interface
  • got-scraping - Got wrapper specifically designed for web scraping purposes
  • got-ssrf - Got wrapper to protect server-side requests against SSRF attacks

Legacy

  • travis-got - Got convenience wrapper to interact with the Travis API
  • graphql-got - Got convenience wrapper to interact with GraphQL

Comparison

got request node-fetch ky axios superagent
HTTP/2 support ✔️¹ ✔️**
Browser support ✔️* ✔️ ✔️ ✔️
Promise API ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
Stream API ✔️ ✔️ Node.js only ✔️
Pagination API ✔️
Request cancelation ✔️ ✔️ ✔️ ✔️ ✔️
RFC compliant caching ✔️
Cookies (out-of-box) ✔️ ✔️
Follows redirects ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
Retries on failure ✔️ ✔️ ✔️
Progress events ✔️ ✔️*** Browser only ✔️
Handles gzip/deflate ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
Advanced timeouts ✔️
Timings ✔️ ✔️
Errors with metadata ✔️ ✔️ ✔️
JSON mode ✔️ ✔️ ✔️ ✔️ ✔️ ✔️
Custom defaults ✔️ ✔️ ✔️ ✔️
Composable ✔️ ✔️
Hooks ✔️ ✔️ ✔️
Issues open
Issues closed
Downloads
Coverage TBD
Build
Bugs
Dependents

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

上一篇:
golang/net: [mirror] Go supplementary network libraries发布时间:2022-06-13
下一篇:
go-swagger/go-swagger: Swagger 2.0 implementation for go发布时间:2022-06-13
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap