public interface ApiRequests { @POST("user/check") Call<JSONObject> login(@QueryMap Map<String, String> options); } Retrofit retrofit = new Retrofit.Builder() .baseUrl(API_SERVER_URL) .build(); ApiRequests api = retrofit.create(ApiRequests.class); Call call = api.login(params); call.enqueue(new Callback<JSONObject>() { @Override public void onResponse(Call<JSONObject> call, Response<JSONObject> response) { .... 

Error: Unable to create converter for class org.json.JSONObject but I don’t need a converter.

    1 answer 1

    Try this type of the returned object: Response<ResponseBody> - from it you can get the server response as a string like this:

     String body = response.body().string(); 

    Then you just have to take any JSON parser and get what you need

    • No, returns: okhttp3.ResponseBody$1@3cafc0b9 - Igor
    • @Igor, update the question, give your current code. What you wrote is the result of calling the object's toString method. Perhaps you need the same string() as in the response to call instead of it. - Yuriy SPb