0

Json data:

{
"userId":"5",
"name" : "mahdi",
"family" : "pishguy",
"id" : [{"1":"2333"},{"2":"12"},{"3":"123"}],
"token" : "10"
}

and I'm trying post with this code:

@Headers("Content-Type: application/json")
@POST("rst_store")
Call<User> saveUser(@Body User User);

Call<User> call = myService.saveUserSeeks(User);
call.enqueue(new Callback<User>() {
    @Override
    public void onResponse(Call<User> call, final Response<User> response) {
        if (response.isSuccessful()) {

        }
    }
    @Override
    public void onFailure(Call<User> call, Throwable t) {
        if (t.getMessage() != null) Log.e("Err: ", t.getMessage());
    }
});

I get this error:

Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $

How can I resolve this problem?

thank you.

tux-world
  • 2,680
  • 6
  • 24
  • 55

0 Answers0