I want to edit request url in the beforeRequest hook.
Thx.
Have you tried? Or are you saying it's not working?
I think he meant the latter.
https://github.com/sindresorhus/ky/blob/83dff35a23a022e2c039ef2e1df966f619f9c206/index.js#L383-L387
https://github.com/sindresorhus/ky/blob/83dff35a23a022e2c039ef2e1df966f619f9c206/index.js#L226
Strings are immutable. We could pass this as the third argument, but that wouldn't be elegant.
Perhaps we should allow beforeRequest hooks to return a Request instance, which we would pass to fetch(). That would allow them to use any URL they want, as well as other options. Should be pretty easy to implement.