Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request] add init hook (similar to got) #431

Open
purepear opened this issue Mar 5, 2022 · 0 comments
Open

[feature request] add init hook (similar to got) #431

purepear opened this issue Mar 5, 2022 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@purepear
Copy link

purepear commented Mar 5, 2022

Having a way to alter the options before initialising the request would be helpful. Currently there's no easy way to alter the searchParams or urlPrefix in a hook. For example, sanitisation/modification of searchParams is only possible through the beforeRequest hook by "deconstructing" and then constructing and returning a new request AFAIK. I think sth like the init hook of got will be useful in these(and other) situations.

@sindresorhus sindresorhus added enhancement New feature or request help wanted Extra attention is needed labels Mar 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants