• Home
  • Raw
  • Download

Lines Matching full:fetch

2 node-fetch-npm
9 A light-weight module that brings `window.fetch` to Node.js
11 `node-fetch-npm` is a fork of [`node-fetch`](https://npm.im/node-fetch) used in
12 npm itself, through [`make-fetch-happen`](https://npm.im/make-fetch-happen). It
14 `node-fetch`'s own design goals (such as picking a specific cookie library,
17 This library is *not a replacement* for `node-fetch`, nor does it intend to
25Fetch polyfill](https://github.com/github/fetch), why not go from native `http` to `fetch` API dir…
27 …somorphic-fetch](https://github.com/matthew-andrews/isomorphic-fetch) for isomorphic usage (export…
32 - Stay consistent with `window.fetch` API.
33 - Make conscious trade-off when following [whatwg fetch spec][whatwg-fetch] and [stream spec](https…
40 ## Difference from client-side fetch
42 - See [Known Differences](https://github.com/npm/node-fetch-npm/blob/master/LIMITS.md) for details.
43 - If you happen to use a missing feature that `window.fetch` offers, feel free to open an issue.
50 $ npm install node-fetch-npm --save
57 import fetch from 'node-fetch';
59 // const fetch = require('node-fetch');
61 // if you are using your own Promise library, set it through fetch.Promise. Eg.
64 // fetch.Promise = Bluebird;
68 fetch('https://github.com/')
74 fetch('https://api.github.com/users/github')
82 fetch('http://domain.invalid/')
88 fetch('https://assets-cdn.github.com/images/modules/logos_page/Octocat.png')
96 // note that buffer() is a node-fetch only API
100 fetch('https://assets-cdn.github.com/images/modules/logos_page/Octocat.png')
107 fetch('https://github.com/')
118 fetch('http://httpbin.org/post', { method: 'POST', body: 'a=1' })
127 fetch('http://httpbin.org/post', { method: 'POST', body: stream })
134 fetch('http://httpbin.org/post', {
148 fetch('http://httpbin.org/post', { method: 'POST', body: form })
159 fetch('http://httpbin.org/post', { method: 'POST', body: form, headers: form.getHeaders() })
166 const res = await fetch('https://api.github.com/users/github');
172 See [test cases](https://github.com/npm/node-fetch-npm/blob/master/test/test.js) for more examples.
177 ### fetch(url[, options])
180 - `options` [Options](#fetch-options) for the HTTP(S) request
183 Perform an HTTP(S) fetch.
187 <a id="fetch-options"></a>
194 // These properties are part of the Fetch Standard
200 // The following properties are node-fetch-npm extensions
219 `User-Agent` | `node-fetch-npm/1.0 (+https://github.com/npm/node-fetch-npm)`
238 The following node-fetch-npm extension properties are provided:
245 See [options](#fetch-options) for exact meaning of these extensions.
252 - `options` [Options][#fetch-options] for the HTTP(S) request
256 In most cases, directly `fetch(url, options)` is simpler than creating a `Request` object.
263 The following properties are not implemented in node-fetch-npm at this moment:
285 …ing over a set of HTTP headers. All methods specified in the [Fetch Standard][whatwg-fetch] are im…
296 // Example adapted from https://fetch.spec.whatwg.org/#example-headers-class
324 The following methods are not yet implemented in node-fetch-npm at this moment:
334 …t. Note that while the [Fetch Standard][whatwg-fetch] requires the property to always be a WHATWG …
357 <small>*(node-fetch-npm extension)*</small>
365 <small>*(node-fetch-npm extension)*</small>
374 <small>*(node-fetch-npm extension)*</small>
385 Thanks to [github/fetch](https://github.com/github/fetch) for providing a solid implementation refe…
388 [npm-image]: https://img.shields.io/npm/v/node-fetch-npm.svg?style=flat-square
389 [npm-url]: https://www.npmjs.com/package/node-fetch-npm
390 [travis-image]: https://img.shields.io/travis/npm/node-fetch-npm.svg?style=flat-square
391 [travis-url]: https://travis-ci.org/npm/node-fetch-npm
392 [codecov-image]: https://img.shields.io/codecov/c/github/npm/node-fetch-npm.svg?style=flat-square
393 [codecov-url]: https://codecov.io/gh/npm/node-fetch-npm
394 [ERROR-HANDLING.md]: https://github.com/npm/node-fetch-npm/blob/master/ERROR-HANDLING.md
395 [whatwg-fetch]: https://fetch.spec.whatwg.org/
396 [response-init]: https://fetch.spec.whatwg.org/#responseinit