title: Retrofit and usage of absolute URLs
body: <p>How can you handle in Retrofit absolute URLs for some calls? </p>
  
  <p>I am using a combination of dagger, retrofit and OKHttp. I provide a @Singleton RestAdapter with the selected endpoint (Production, Staging, etc) which it is formed from the BASE URL.</p>
  
  <pre><code>@Provides
      @Singleton
      RestAdapter providesRestAdapter(Endpoint endpoint,
                                      ObjectMapper jacksonObjectMapper,
                                      Client client,
                                      ApiRequestInterceptor headers) {
  
          return new RestAdapter.Builder() //
                  .setClient(client) //
                  .setEndpoint(endpoint) //
                  .setConverter(new JacksonConverter(jacksonObjectMapper))
                  .setLogLevel(RestAdapter.LogLevel.FULL)
                  .setRequestInterceptor(headers) //
                  .build();
      }
  </code></pre>
  
  <p>The problem is that the REST service, for some cases, returns the URL for the content to be loaded in ABSOLUTE format meaning something like <a href="http://someurl.com/resource?sort=ascendent" rel="nofollow">http://someurl.com/resource?sort=ascendent</a> and not the preferable /resouce?sort=ascendent (without the BASE_URL)</p>
  
  <p>Now the question is how I can create the interface of the service to deal with such scenario? </p>
  
  <p>I was thinking something like: </p>
  
  <pre><code>public interface PlaceholdersService {
  
      @GET("{placeholderHref}")
      public void getPlaceholder(@EncodedPath("placeholderHref") String placeholderHref);
  
  }
  </code></pre>
  
  <p>The problem is that I am not sure if the BASE URL set in the Endpoint previously when creating the RestAdapter will be added (can't test it at the moment). </p>
  
  <p>Another though was to create a new RestAdapter specially for this case with an Endpoint set to a null or empty string fixed point like Endpoints.newFixedEndpoint(null) or Endpoints.newFixedEndpoint(""). </p>
  
  <p>Any suggestions? </p>
  
  <p>Thanks</p>