Stack Exchange
i want to post nested json data
i want to post this data to the server. i an getting null response. what do get response from server
 {
    "test_id":5,
    "user_id":null,
    "org_id":2,
    "schedule_id":15,
    "group_id":null,
    "next_section_id":"",
    "current_section":
       {

        }
    }

i create interface
@POST("take_tests")
Call<Test_Responce> testRes (@Body JSONObject paramObject);

function
try {
            JSONObject paramObject = new JSONObject();
            JSONObject current_section = new JSONObject();

            paramObject.put("test_id", 5);
            paramObject.put("user_id", "null");
            paramObject.put("org_id", 2);
            paramObject.put("schedule_id", 15);
            paramObject.put("group_id", "null");


            paramObject.put("current_section",current_section);


            Call<Test_Responce> userCall = api_interface.testRes(paramObject);
            userCall.enqueue(new Callback<Test_Responce>() {
                @Override
                public void onResponse(Call<Test_Responce> call, Response<Test_Responce> response) {
                    if (response.isSuccessful()){
                        Toast.makeText(getApplicationContext(),"success",Toast.LENGTH_SHORT).show();
                    }else {
                        Toast.makeText(getApplicationContext(),"else",Toast.LENGTH_SHORT).show();

                    }
                }

                @Override
                public void onFailure(Call<Test_Responce> call, Throwable t) {
                    Toast.makeText(getApplicationContext(),"fail",Toast.LENGTH_SHORT).show();
                }


Try using JsonObject from gson (dont use JSONObject)
JsonObject paramObject =new JsonObject();
paramObject.addProperty("test_id", 5);
paramObject.addProperty("user_id", "null");
paramObject.addProperty("org_id", 2);
paramObject.addProperty("schedule_id", 15);
paramObject.addProperty("group_id", "null");

JsonObject current_section =new JsonObject();
paramObject.add("current_section",current_section);

and change interface like this
@POST("take_tests")
Call<Test_Responce> testRes(@Body JsonObject paramObject);


Post your data like this 
    private JsonObject ApiJsonMap() {
    JsonObject gsonObject = new JsonObject();
    try {
        JSONObject jsonObj_ = new JSONObject();
        jsonObj_.put("key", "value");
        jsonObj_.put("key", "value");
        jsonObj_.put("key", "value");
        JsonParser jsonParser = new JsonParser();
        gsonObject = (JsonObject) jsonParser.parse(jsonObj_.toString());
        //print parameter 
        Log.e("MY gson.JSON: ", "AS PARAMETER " + gsonObject);
    } catch (JSONException e) {
        e.printStackTrace();
    }
    return gsonObject;
}

You need to create gson object
For more help want to go step by step
Check my ans  :
How to post raw whole json data using retrofit
