Got: Deprecation of path parameter in options in got 10

Created on 2 Dec 2019  Â·  3Comments  Â·  Source: sindresorhus/got

Hello,
With got 10, the path option parameter is deprecated but the got documentation says options can contain "Any of the https.request options".
This node doc page documents the path option. I have understand that I can use options pathname + searchParams to achieve the same result but there is, I think, a regression or a documentation issue. path can be useful in some cases, so why deprecate it ?

Checklist

  • [x] I have read the documentation.
documentation ✭ help wanted ✭

All 3 comments

It's definitely not a regression. You should use pathname instead (or any URL property).

It's made like that to normalize the URL better. Previously Got was using the legacy Url API, which has been deprecated. We need to normalize the URL so you can take a look at it using hooks and modify it if necessary.

Since it's popular it's been made backwards-compatible: b3f1ac9c9725459f4ffab9baa20b9459d3495fba

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dominusmars picture dominusmars  Â·  3Comments

khizarsonu picture khizarsonu  Â·  3Comments

jamestalmage picture jamestalmage  Â·  3Comments

sindresorhus picture sindresorhus  Â·  3Comments

carvallegro picture carvallegro  Â·  4Comments