Closed Master-Antonio closed 4 years ago
I fixed doing:
HttpUrl httpurl = new HttpUrl.Builder()
.scheme("https")
.host("api.modernmt.eu")
.addPathSegment("translate")
.addQueryParameter("source", sourceLanguage)
.addQueryParameter("target", targetLanguage)
.addQueryParameter("q",string)
.build();
and after in request .url(httpurl)
I dont understand the difference, but creating the object HttpUrl now the answer from server is in correct way.
This is a better question for stackoverflow, this isn't a reproducible bug given the request requires a auth token.
im calling a GET Api (API of ModernMTT) with OkHttp (Last version), my problem is that the reply from the server is not in UTF-8 but in Percent Encoding, and i dont understand why, i try to set the Content-Type to UTF-8 without result. I tried also to Decode without result.
URLDecoder.decode(stringDecoded, StandardCharsets.UTF_8)
From CURL and Postman the server reply good. So the problem is on OkHttp. My codeThe response.body.string() return this format: