You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like a way to use extend() and append to the existing prefixUrl:
constapi=ky.create({prefixUrl: "https://www.example.com/api"});constsales=api.extend({path: "sales/v1"});awaitsales.post("offers",{json: {}});// POSTs to https://www.example.com/api/sales/v1/offers
Today if I use prefixUrl in an extend() call then it overwrites the "base" prefixUrl and I don't see any way to access the configured prefixUrl from the "base" KyInstance. Is this already possible and I've overlooked it?
The text was updated successfully, but these errors were encountered:
I think something like this would be useful. It should probably be called appendPath to make it clear what it does. I would like to see feedback more people first though.
+1 ! This functionality can be useful when an API has multiples levels.
I also think this should be under a new function to avoid breaking change and explicit behavior.
I'd like a way to use
extend()
and append to the existingprefixUrl
:Today if I use
prefixUrl
in anextend()
call then it overwrites the "base"prefixUrl
and I don't see any way to access the configuredprefixUrl
from the "base"KyInstance
. Is this already possible and I've overlooked it?The text was updated successfully, but these errors were encountered: