-
Notifications
You must be signed in to change notification settings - Fork 116
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
Support paths in base url #4
Comments
Thanks for the feedback. I'll consider this. |
In my use case, I also need to do this. Would be nice to have as a config option. I'm willing to submit a PR if you want |
@keedo, PRs are welcome. |
Note that we're not stripping - the base url is the host portion of the url and then we add the relative paths. What it should do is if the "base url" has a path portion, it should save that off and then on every request pre-pend to the path given. Will need a bunch of tests for combinations ... PRs welcome or I will get to soon. |
Created PR for this: #23 |
done |
I'm using |
Just had a bug that turned out to be caused by the base "url" effectively being a "base domain."
For example, if you set the base url to
http://example.com/common/base/path
and then call a method with a relative path of/relative/path
the client will end up callinghttp://example.com/relative/path
.From my experience, it's pretty common for REST API's to have a common base url that includes path elements and it is also common for client implementations to accept common path elements in the base url.
I think it would be a lot more user-friendly and conventional to support path elements in the base url.
The text was updated successfully, but these errors were encountered: