Feature Request
@Url annotation hidden combining with baseUrl is a non-intuitive way.
For instance it doesn't allow request for dynamic urls - if there is no scheme provided, it adds baseUrl which breaks request.
Also for purposes of combining baseUrl with multiple paths - there are already paths in @Get, @Post annotations and @Path param.
Suggestions:
@RelativeUrl and move there current @Url combining logic@Url always work as absolute url.Or kind of workaround:
@AbsoluteUrl that will always work as absolute url.Can you provide a specific example that doesn't work? Relative resolution, absolute resolution, full URLs all work today.
non-intuitive way
It's the same as <a href=""> and pretty standard faire for resolving one URI against another.
@JakeWharton
As I wrote, specific example:
if there is no scheme provided, it adds baseUrl which breaks request.
When fetching web url without scheme (link preview on user provided data functionality) - url is prefixed with baseUrl, and as I can see for now - there is no way to keep url as it was provided by the user
Some ways to resolve URLs that already works with Retrofit:
https://example.com/path : full URL
//example.com/path : scheme-relative
/path : absolute path
path : relative path
We didn't invent this for Retrofit. It's how URLs work.
@swankjesse As I wrote - I need an option to open any url as absolute url, no matter the content - it's user provided data.
Then you should be using OkHttp's API directly instead of Retrofit. Retrofit is for structured APIs and URLs known at compile-time.
Most helpful comment
Then you should be using OkHttp's API directly instead of Retrofit. Retrofit is for structured APIs and URLs known at compile-time.