request / request

🏊🏾 Simplified HTTP request client.
Apache License 2.0
25.67k stars 3.14k forks source link

Docs on migrating from request to fetch? #3480

Open JoshuaKGoldberg opened 4 months ago

JoshuaKGoldberg commented 4 months ago

Overview

👋 Coming over from https://github.com/Munter/hyperlink/issues/200: I'd like to migrate hyperlink over to using native fetch(). It looks pretty straightforward except for two request() options:

gzip looks like it can be dropped:

https://github.com/request/request/blob/3c0cddc7c8eb60b470e9519da85896ed7ee0081e/README.md?plain=1#L1038-L1039

...but strictSSL I don't understand how it's different from fetch():

https://github.com/request/request/blob/3c0cddc7c8eb60b470e9519da85896ed7ee0081e/README.md?plain=1#L842

Could we please have a guide on how to migrate off some of these non-standard properties? I think it'd be helpful for anybody who, like me, isn't familiar with request and is wondering about their nuances.

Note that this is not the same as what's currently in #3143. That's a summary table of alternative libraries that doesn't go into depth.

msimerson commented 3 months ago

strictSSL is fairly straight forward. If you search this repo for strictSSL, you'll find this:

if (self.strictSSL === false) {
    self.rejectUnauthorized = false

rejectUnauthorized is a node tls option.