Commit Graph

125 Commits

Author SHA1 Message Date
Michal Miky Jankovský 8ced5b941c
docs: readme - non ESM example (#1707) 2023-02-01 11:26:05 +07:00
dhananjaysa92 c071406e19
(1138) - Fixed HTTPResponseError with correct constructor and usage (#1666)
Co-authored-by: Dhananjay Agrawal <dhananjay.agrawal@aexp.com>
2022-10-30 21:17:53 +01:00
Naresh Rawat 6f72caa401
docs: fix missing comma in example (#1623) 2022-08-10 14:59:10 +02:00
Moni 95165d5480
fix spelling (#1602) 2022-07-13 20:36:00 +02:00
Tom a92b5d5cf4
fix: use space in accept-encoding values (#1572)
* fix for issue #1571

* Update README.md

Co-authored-by: Jimmy Wärting <jimmy@warting.se>
2022-06-01 21:43:48 +02:00
Jimmy Wärting 0f122b8824
docs: fix formdata code example (#1562) 2022-05-27 14:31:17 -07:00
Russell Dempsey 6ae9c76481
docs(readme): response.clone() is not async (#1560)
source code shows response is a sync call to a new Response constructor: 3944f24770/src/response.js (L84-L101)
2022-05-20 14:55:15 +02:00
George B 6875205c1a
docs: Fix link markup to Options definition (#1525) 2022-03-28 12:07:18 +03:00
Software and Outsourcing 61b3b5a063
fix: cancel request example import (#1513)
* Fix example

* Fix formatting

Co-authored-by: Linus Unnebäck <linus@folkdatorn.se>

Co-authored-by: Linus Unnebäck <linus@folkdatorn.se>
2022-03-01 10:54:27 +01:00
csimpf 5e78af3ba7
Replace changelog with valid url (#1506) 2022-02-11 09:13:57 +01:00
rieg-ec 4ce2ce5f1b
docs(readme): fix typo (#1489) 2022-01-27 16:48:55 +01:00
Jimmy Wärting 0b43b9f905
docs: update formdata example (#1465)
* docs: update formdata and blob examples

* lint fixes

* tab to space

* tab to space

* tab to space
2022-01-22 00:36:54 +01:00
Travis D. Warlick, Jr 5304f3f7f7
Don't change relative location header on manual redirect (#1105)
* Don't change relative location header on manual redirect

* c8 ignores for node-version-specific code and fix c8 ignore in Headers constructor
2022-01-15 22:08:16 +01:00
dnalborczyk 41f53b9065
fix: use more node: protocol imports (#1428)
* fix: use node: protocol

* use node: protocol in readme
2021-12-28 16:39:53 +01:00
Adam 7ba5bc9e0a
update readme for TS @type/node-fetch (#1405)
Co-authored-by: adamellsworth <adam.d.ellsworth@me.com>
2021-12-06 17:03:27 +01:00
Jimmy Wärting 3f0e0c2949
docs: Fix typo around sending a file (#1381) 2021-11-12 12:31:29 +01:00
Jimmy Wärting ff71348b7b
docs: Update code examples (#1365)
* remove buffer example

* show example of posting and getting a formdata instance

* recommend using builtin AbortController

* recommend posting blob instead of stream

* we do support formdata
2021-11-08 19:09:18 +01:00
Jimmy Wärting 3944f24770
feat(Body): Added support for `BodyMixin.formData()` and constructing bodies with FormData (#1314)
Added support for body toFormData
2021-11-08 12:51:49 +01:00
Ambrose Chua 37ac459cfd
docs: Improve clarity of "Loading and configuring" (#1323)
* docs: Improve clarity of "Loading and configuring"

* Update README.md

Co-authored-by: Linus Unnebäck <linus@folkdatorn.se>

Co-authored-by: Linus Unnebäck <linus@folkdatorn.se>
2021-11-05 13:33:22 +01:00
Jiralite a3a5b6316e
chore: Correct stuff in README.md (#1361) 2021-11-05 13:20:21 +01:00
Travis D. Warlick, Jr 2d80b0bb3f
Add support for Referrer and Referrer Policy (#1057)
* Support referrer and referrerPolicy

* Test TS types for addition of referrer and referrerPolicy

* Fix lint issues and merge error
2021-11-05 10:26:13 +01:00
Daniel Hritzkiv 4972e00905
docs: switch url to URL
Consistent capitalization of 'URL'
2021-10-07 12:25:54 +02:00
Dan Fernandez 52b743b4f0
Update README.md to fix HTTPResponseError (#1135)
In the 'Handling client and server errors', the class HTTPResponseError constructor has to call 'super()' before accessing 'this.response'

Not doing this throws the following exception: "ReferenceError: Must call super constructor in derived class before accessing 'this' or returning from derived constructor"

Fix: This just changes the order so super(...) is first, then this.response...

MDN Reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/super#using_super_in_classes
2021-10-07 11:06:38 +02:00
robertoaceves 3b99832e23
Add default Host request header to README.md file (#1316)
Mention the Host header in the default request headers table.

According to the standard [RFC 7230 Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing |https://httpwg.org/specs/rfc7230.html#header.host]
    "A client MUST send a Host header field in all HTTP/1.1 request messages."
2021-09-27 19:06:05 +02:00
David Adi Nugroho 9cd2e43e62
Fix octocat image link (#1281)
Co-authored-by: Richie Bendall <richiebendall@gmail.com>
2021-09-10 00:20:08 +12:00
Jimmy Wärting 2f1b426a98
docs: Add example for loading ESM from CommonJS (#1236)
* docs: Documented other ways to load ESM

* finegraned -> fine graned

* change require to import

* await response and discourage res.buffer()

* corrected minimum node version required

* updated changelog

* docs: Fix spelling

* docs: encourage v2 from cjs
2021-08-28 02:10:08 +02:00
Richie Bendall 136a5f1433
Add link to v2 docs (#1202) 2021-08-08 02:42:00 +12:00
Antoni Kepinski b50fbc1057
Require Node.js 12.20.0 and move to ESM (#1141)
* Use ESM import in runkit example file

* Update dependencies, version and transition to ESM

* Use ESM imports, add ESM-related info

* Remove rollup

* Lint TypeScript-related files

* Update dependency

* Lint & update dependency

* Lint

* Remove commonjs tests

* chore: update changelog

* Remove commonjs GitHub action

* Update funding.yml

* Update linter rules

* Lint

* Fix tsd

* Remove unnecessary types

* Simplify

* Use top-level await

* Update GitHub Actions

* Use Mocha with ESM

* Revamp

* specify what node version

* update formdata-node dep

* remove lint from example using top await

* updated name and link to formdata-polyfill

* Stop recommend form-data

* filter example - it has many duplicate variables

* Update type definitions to ESM

* Remove unused lint rule disable comment

* Remove leftover rollup and dist folder

* updated depn

* updated d.ts

* lint

* Fix breaking changes with blob v3 stream()

* revert eslint comment

* revert back to xo 0.39

Don't want to deal with all those new rules right now. will fix it later
fixed some of them...

* none TS fan trying to fix type definition

* Give me a break

* Test on all minimum supported Node.js versions (#1170)

* Test on all minimum supported Node.js versions

* Tweak Node.js workaround version range

* Handle Node.js 16 aborted error message

* fix node version string compare

Co-authored-by: Jimmy Wärting <jimmy@warting.se>

* bumped fetch-blob version

* import from dom lib

* rm unused comment

* updated required version in docs

* fixed named import

* set lowest support to 12.20.0

* comment explaining both

* rm log

Co-authored-by: Jimmy Wärting <jimmy@warting.se>
Co-authored-by: Linus Unnebäck <linus@folkdatorn.se>
2021-07-18 22:15:19 +02:00
Tanguy Krotoff 3b50b0c4e6
Add support for Response.error() (#1078) 2021-05-03 23:09:37 +02:00
Berkan Sivri 9e50c5bbc1
Update README.md (#1112) 2021-03-10 21:45:43 -05:00
Travis D. Warlick, Jr 8eeeec18c1
Fix premature close with chunked transfer encoding and for async iterators in Node 12 (#1064)
Co-authored-by: Irakli Gozalishvili <contact@gozala.io>
2021-02-23 07:14:09 +00:00
Sami Jaber e333578417
fix formdata-node example (#1068) 2021-01-24 00:50:15 +01:00
James Bart Dorsey 1c30aec334
Removing confusingly named 'json' variable in examples (#1073)
Using a variable named "json" for the parsed JSON data is confusing, because at that point the data is __not__ JSON anymore.
2021-01-24 00:49:29 +01:00
Travis D. Warlick, Jr 7038d8d0c1
Readme tweaks (#1021)
Co-authored-by: Richie Bendall <richiebendall@gmail.com>
2020-12-06 22:42:56 +01:00
Konstantin Vyatkin 1fdc218a64
fix window.fetch (#875) 2020-06-11 15:52:02 -04:00
Nick K a38b533ad6
feat: Implement form-data encoding (#603)
Co-authored-by: Steve Moser <contact@stevemoser.org>
Co-authored-by: Antoni Kepinski <xxczaki@pm.me>
Co-authored-by: Richie Bendall <richiebendall@gmail.com>
Co-authored-by: Konstantin Vyatkin <tino@vtkn.io>
Co-authored-by: aeb-sia <50743092+aeb-sia@users.noreply.github.com>
Co-authored-by: Nazar Mokrynskyi <nazar@mokrynskyi.com>
Co-authored-by: Erick Calder <e@arix.com>
Co-authored-by: Yaacov Rydzinski <yaacovCR@gmail.com>
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-06-10 22:31:35 +02:00
arc298 1973503453
fix: updates README to use correct response variable in Advanced Usage (#862)
Co-authored-by: arc298 <rarcega@users.noreply.github.com>
2020-06-05 22:24:32 +02:00
Matti Schneider b121feb8f5
Fix Headers import statement (#859) 2020-06-04 13:33:22 -04:00
Christian Kruse af7e67f504
Add insecureHTTPParser Parameter (#856)
Keep whitespace consistent
2020-06-04 11:54:02 -04:00
Konstantin Vyatkin 769f75d054
Drop custom Promises and refactor to `async` functions (#845)
* refactor to async

* no custsom promises anymore

* restore server premature handler

* simplify

* fixing break

* lint

* remove promise dependency

* fix docs
2020-05-28 23:57:57 +02:00
Antoni Kepinski fa627f4b0c
Follow xo linter rules more strictly (#829)
Co-authored-by: Moni <40552237+NotMoni@users.noreply.github.com>
2020-05-25 17:11:56 +02:00
Konstantin Vyatkin b3878b9a3e
Fix default user agent string (#818)
Co-authored-by: Antoni Kepinski <xxczaki@pm.me>
2020-05-25 16:56:04 +02:00
Richie Bendall 94e5b92de1
Remove `timeout` option (#831) 2020-05-25 13:30:05 +02:00
Antoni Kepinski 937a254eea
Normalize badges style 2020-05-23 11:59:12 +02:00
Konstantin Vyatkin 28655e1390
Add Brotli support in Request (#819)
* document and request brotli

* Document different minimum version

Co-authored-by: Richie Bendall <richiebendall@gmail.com>
2020-05-22 22:48:14 -04:00
Konstantin Vyatkin 912348d5dc
Fix GitHub Actions (#820)
* fix test command
* use action for coverage upload
* specify branch
* limit paths
* forgot install
* fix badge
* don't need a workaround for Node 10
* shorten CI name
2020-05-22 21:42:48 -04:00
Moni 29d7556870
Move to Github Actions (#785)
* Move to Github Actions
* remove Travis in favor of GitHub Actions

Signed-off-by: Moni <40552237+NotMoni@users.noreply.github.com>
Co-authored-by: Linus Unnebäck <linus@folkdatorn.se>
Co-authored-by: Konstantin Vyatkin <tino@vtkn.io>
2020-05-22 16:35:14 -04:00
Paul 6e12fe22ad
Fix example using `file-type` (#804) 2020-05-18 16:17:14 +12:00
Antoni Kepinski 8a3d2638ae
Merge branch 'master' of https://github.com/node-fetch/node-fetch 2020-05-17 19:03:39 +02:00
Antoni Kepinski c070ffee7e
docs: improve readability 2020-05-17 19:03:31 +02:00