I have a chain of two Play Framework applications. The first is the GatewayServer and the second the InformationServer. The first makes an web service call to the second and should return html to the calling browser - but there the html is only displayed as text. Here is my code:
response.body is a String, so Play is using the default Writeable[String] instance, which uses the content-type text/plain (ContentTypes.TEXT). If you want to treat it as text/html you can use:
Ok(response.body).as(ContentTypes.HTML)
In your case you could also do something like:
Ok(response.bodyAsBytes).as(response.contentType)
That would just forward the body and content-type from your response as-is.