Possible way to make OkHTTP post request without a request body in okhttp library ?
RequestBody reqbody = RequestBody.create(null, new byte[0]);
Request.Builder formBody = new Request.Builder().url(url).method("POST",reqbody).header("Content-Length", "0");
clientOk.newCall(formBody.build()).enqueue(OkHttpCallBack());
"".toRequestBody()
"".toRequestBody("application/json".toMediaTypeOrNull())
...depends on which media type your endpoint expects.
This worked for me:
RequestBody body = RequestBody.create(null, new byte[]{});