2016-03-02 75 views

回答

31
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()); 
+0

这是你的回答或问题? –

+1

这有什么新东西?我得到了相同的[https://github.com/square/okhttp/issues/751](https://github.com/square/okhttp/issues/751) –

10

这为我工作:

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

或'RequestBody.create(null,“”) ' – mr5