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

support relative paths #73

Open
craffael opened this issue Mar 29, 2017 · 0 comments
Open

support relative paths #73

craffael opened this issue Mar 29, 2017 · 0 comments

Comments

@craffael
Copy link

A REST API endpoint often has a "baseURI" such as https://api.mailgun.net/v3. A concrete endpoint has e.g. the full URI https://api.mailgun.net/v3/abc.ch/events.

It would now be very nice if we could write:

RESTClient client = new RESTClient("https://api.mailgun.net/v3")
client.get(path: "abc.ch/events")

Unfortunately this results in a GET request to https://api.mailgun.net/abc.ch/events instead of https://api.mailgun.net/v3/abc.ch/events (the v3 is missing!).

Therefore I propose that the path of the baseURI and the provided path (from the client.get() call) are merged to create the final URI. At the moment the path of the baseURI is replaced.

I think it would be a very simple change in groovyx.net.http.URIBuilder#setPath() which I could submit myself. What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant