android - Django Rest Framework + gson : utf-8 can't decode -
I am working with Django Rest Framework to build my API and with Android + GSON in my client side I am working. There is a problem with encoding when I try to send a POST with a field "country" and the value "Peru". I got the error:
{"detail": "JSON parse error - 'utf8' codec can not decode byte 0xfa in position 15: invalid start byte"}
I have changed a parameter in my post with it:
postRequest.setEntity (New String Entity (GS.N.Togson (object), HTTP.UTF_8);
The server does not return the same error to me, but it throws an HTTP 500 error. Is there a way to manage it in the client or server side? Which one do you recommend?
Comments
Post a Comment