Skip to content

Custom request URL

Ahmad K. Bawaneh edited this page Dec 28, 2019 · 2 revisions

Custom request URL

In some cases like when we work with HATEOAS links the request url isnt fixed and is received from the response of another rest request, and so using service root or Path mapping does not work, in this case we can leave the value for @Path annotation empty and use the request setUrl method to set the url, this method will override any other path setup.

Example

MoviesServiceFactory.INSTANCE
    .updateMovie(movie)
    .setUrl("http://localhost:6060/movies")
    .onSuccess(aVoid -> {
        //do something on success
    })
    .onFailed(failedResponse -> {
        //do something on error
    })
    .send();