I am using okhttp3.RequestBody to send request to server, if I have JSONObject with data I need to send I am writing code like this:
RequestBody requestBody = new MultipartBody.Builder()
.setType(MultipartBody.FORM)
.addFormDataPart("id", object.optLong(Comment.TASK_ID_JSON_TAG) + "")
.addFormDataPart("type", "IMAGE")
.addFormDataPart("latitude", object.optDouble(Comment.LATITUDE_JSON_TAG) + "")
.addFormDataPart("longitude", object.optDouble(Comment.LONGITUDE_JSON_TAG) + "")
.build();
now if I have JSONObject with large data is there a way to create RequestBody directly?
thanks for help.