Repository URL to install this package:
|
Version:
1.0.0-1 ▾
|
This is an important security release. It is strongly recommended to update as soon as possible.
size option after following a redirect.options.agent, it now accepts a function that returns custom http(s).Agent instance based on current URL, see readme for more information.Content-Length was returned for stream body in 2.5.0 release; note that node-fetch doesn't calculate content length for stream body.Response.url should return empty string instead of null by default.Response object now includes redirected property.fetch() now accepts third-party Blob implementation as body.package-lock.json generation as we never commit them.Blob import rule for node < 10, as Readable isn't a named export.Brotli compression support (using node's zlib).Blob implementation per spec.URLSearchParams.Headers now reject empty header names.AbortSignal support, with README example.Location header during redirect by rejecting them explicitly with FetchError.browser.js to support react-native environment, where self isn't available globally.compress flag shouldn't overwrite existing Accept-Encoding header.import rules, where PassThrough etc. doesn't have a named export when using node <10 and --exerimental-modules flag.ArrayBuffer view types--experimental-modules mode; deprecate .es.js file__esModule property to the exports objectBody methods to work on ArrayBuffer-backed Body objectsBody methods when the accumulated Buffer exceeds the maximum sizeHost headers with any casingfetch() from TypeScript in browser.jsFix packaging errors in v2.1.0.
body of a fetch() or RequestHeaders object internally with the given case, for compatibility with older servers that incorrectly treated header names in a case-sensitive mannerLocation header just like non-redirect responsesThis is a major release. Check our upgrade guide for an overview on some key differences between v1 and v2.
require('node-fetch/lib/response') etc. is now unsupported; use require('node-fetch').Response or ES6 module importsObject.prototype.toString() on Headers, Requests, and Responses return correct class stringsencoding module is now optional (alpha.7)import node-fetch by exposing default (alpha.9)Content-Length if we can be sure our information is correct (per spec)whatwg-url package or require('url').URL in Node.js 7+response.text() no longer attempts to detect encoding, instead always opting for UTF-8 (per spec); use response.textConverted() for the v1 behaviorresponse.json() throw error instead of returning an empty object on 204 no-content respose (per spec; reverts behavior changed in v1.6.2)GET or HEAD Request is constructed with a non-null body (per spec)response.arrayBuffer() (also applies to Requests)response.blob() (also applies to Requests)URLSearchParams is now accepted as a bodyresponse.json() json parsing error as FetchErrornull bodyheaders.getAll(); make get() return all headers delimited by commas (per spec)See changelog on 1.x branch for details.
FetchError designform-data 2.x releases (requires form-data >= 2.1.0)res.body is a non-stream non-formdata object, we will call body.toString and send it as a stringcounter value is incorrectly set to follow value when wrapping Request instanceres.buffer() api for convenience, it returns body as a Node.js bufferreq.body now accepts a Node.js buffercontent-length when form-data body use streamsmanual should work even when there is no redirection or broken redirectionError (thx to @pekeler)FetchError contains err.type and err.code, allows for better error handling (thx to @pekeler)manual and error, allows for location header extraction (thx to @jimmywarting for the initial PR)clone method (thx to @kirill-konshin for the initial PR)forEach method (thx to @tricoder42)Content-Length header is set when body is string for POST/PUT/PATCH requestsContent-Encoding headerGET on subsequent request per Fetch SpecRequest and Response constructors now parse headers input using HeadersFormData spec on node.js, this is form-data specific feature)fetch.Request is exposed as wellHeaders now normalized Number value to String, prevent common mistakesHeaders should only support String and Array properties, and ignore othersHeaders instancefollow = 0, fetch should not follow redirect