node-fetch/LIMITS.md

31 lines
1.4 KiB
Markdown
Raw Normal View History

2015-01-26 09:46:32 -08:00
2015-05-03 03:07:20 -07:00
Known differences
=================
2015-01-26 09:46:32 -08:00
2016-12-08 19:18:06 -08:00
*As of 2.x release*
2015-01-26 09:46:32 -08:00
2016-09-11 08:08:11 -07:00
- Topics such as Cross-Origin, Content Security Policy, Mixed Content, Service Workers are ignored, given our server-side context.
2015-01-26 09:46:32 -08:00
2016-09-11 08:08:11 -07:00
- URL input must be an absolute URL, using either `http` or `https` as scheme.
2015-01-26 09:46:32 -08:00
2017-02-26 16:52:32 -08:00
- On the upside, there are no forbidden headers.
2015-01-26 09:46:32 -08:00
2017-02-26 16:52:32 -08:00
- `res.url` contains the final url when following redirects.
2015-01-26 09:46:32 -08:00
2017-02-26 16:52:32 -08:00
- For convenience, `res.body` is a Node.js [Readable stream][readable-stream], so decoding can be handled independently.
2015-01-26 09:46:32 -08:00
2017-02-26 16:52:32 -08:00
- Similarly, `req.body` can either be `null`, a string, a buffer or a Readable stream.
- Also, you can handle rejected fetch requests through checking `err.type` and `err.code`. See [ERROR-HANDLING.md][] for more info.
2016-04-05 10:32:37 -07:00
2016-12-08 19:18:06 -08:00
- Only support `res.text()`, `res.json()`, `res.blob()`, `res.arraybuffer()`, `res.buffer()`
2015-01-27 10:02:27 -08:00
2015-01-27 05:11:26 -08:00
- There is currently no built-in caching, as server-side caching varies by use-cases.
2016-09-11 08:08:11 -07:00
- Current implementation lacks server-side cookie store, you will need to extract `Set-Cookie` headers manually.
- If you are using `res.clone()` and writing an isomorphic app, note that stream on Node.js have a smaller internal buffer size (16Kb, aka `highWaterMark`) from client-side browsers (>1Mb, not consistent across browsers).
2017-02-26 16:52:32 -08:00
[readable-stream]: https://nodejs.org/api/stream.html#stream_readable_streams
[ERROR-HANDLING.md]: https://github.com/bitinn/node-fetch/blob/master/ERROR-HANDLING.md