WSClient - Promise appears to be ignored

I’m using Play 2.8.

I am making a request for a web service using WSClient. But the callback function seems to be ignored, the result is a status 200 and an empty body instead of what is in the code.

public class ApplicationController extends Controller{

	@Inject WSClient ws;
	public CompletionStage<Result> echoService() {		
		return ws.url("")
				.thenApply(response -> internalServerError("Feed Response: " + response.getBody()));


play {

	filters.disabled += "play.filters.hosts.AllowedHostsFilter"

I’m making the request from localhost.

Sorry for my English.

Please help!

Hi @MarcioNarciso,

are you sure that you are calling the right action / controller?

The response I am seeing is this:

HTTP/1.1 500 Internal Server Error
Content-Length: 40
Content-Type: text/plain; charset=UTF-8
Date: Mon, 25 May 2020 07:45:18 GMT
Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-Permitted-Cross-Domain-Policies: master-only
X-XSS-Protection: 1; mode=block

Feed Response: {
    "resposta" : "oi"

Hi @cbley!

In fact, it works!
I tested it in a isolated case and it worked, what I had posted was a fragment of a class.
I’ll keep looking for the problem in it.

Thanks for your help!