问题
I'm working on a play application that uses WS to make an asynchronous call to an external api and I can't figure out why I'm losing unicode chars when consuming
for instance if they api is producing something like:
{ "title": "Plück, Franke" }
and make a call to the api with:
ws.url("http://example.org/stuff/").get().map { response =>
println(response.body)
Ok....
The following will print:
{ "title":"Plück, Franke" }
I'm trying to find if there is a header argument that I need to be passing to the WSRequest object to preserve the character set? The WSRequest documentation for the setContentType method states
"Set the content type. If the request body is a String, and no charset parameter is included, then it will default to UTF-8."
What am I missing?
Thanks! AH
回答1:
This was a bug in the version of Play I was using (2.6.3) I upgraded to 2.6.7 and all was remedied.
来源:https://stackoverflow.com/questions/46456069/play-framework-ws-losing-unicode-chars-from-external-api