playframework/playframework — pull request #3519 by gmethvin (2014-10-28 06:15:06+00:00)
Title: WSResponse does not show contentType

Possible encoding bug from

https://stackoverflow.com/questions/26409801/play-framework-ning-ws-api-encoding-issue-with-html-pages

So, looking at the HTTP header from the site, it is:

HTTP/1.1 200 OK
Content-Type: text/html
X-UA-Compatible: IE=edge
P3P: policyref="http://www.walla.co.il/w3c/p3p.xml", CP="NOI DSP COR NID CURa TAIa OUR IND UNI COM NAV"
Content-Encoding: gzip
Vary: Accept-Encoding
Date: Thu, 16 Oct 2014 18:28:21 GMT
Content-Length: 16958
Connection: keep-alive

The header is

As the text says "[only one of these elements is required to set the character set to UTF-8][1]".

Looking at the [HTML W3 Validator](http://validator.w3.org/) service and entering the URL, it is detected as UTF-8. So, my guess is that it's Curl doing some additional charset detection there.

However, even if the source is wrong, there should be a way to call response.contentType, and there isn't. So filing this bug.

https://groups.google.com/d/topic/asynchttpclient/eY5uevka6Rg/discussion

[1]: http://oli.jp/2009/html5-charset/