I think it should be:
@Override
public Result apply(WS.Response response) throws Throwable {
return ok(response.getBody()).as(response.getHeader("Content-Type"));
}
Question
I am making a Web service call from Java Play framework. Below is the code.
WS.url(url).get().map(
new F.Function<WS.Response, Result>() {
@Override
public Result apply(WS.Response response) throws Throwable {
return ok(response.getBody())
}
}
);
How do I return the content type as the content type of the WS.Response ?
La solution
I think it should be:
@Override
public Result apply(WS.Response response) throws Throwable {
return ok(response.getBody()).as(response.getHeader("Content-Type"));
}