如何使没有请求正文的OKHTTP发布请求?

okhttp库中没有请求正文的OkHTTP post请求的可能方法?

Solutions Collecting From Web of "如何使没有请求正文的OKHTTP发布请求?"

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()); 

这对我工作:

 RequestBody body = RequestBody.create(null, new byte[]{});