Possible way to make OkHTTP post request without a request body in okhttp library ?
Justcurious
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());
This worked for me:
RequestBody body = RequestBody.create(null, new byte[]{});
来源:https://stackoverflow.com/questions/35743516/how-to-make-okhttp-post-request-without-a-request-body