2016-03-02 112 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