2011-04-27 35 views

回答

8

ByteArrayEntity應該是您需要的信息:

[...] 
PostMethod post = new PostMethod(url); 
post.setRequestEntity(new ByteArrayEntity(bytes)); 
post.setRequestHeader("Content-type", "application/octet-stream"); 
[...] 

您必須設置content-type匹配你所擁有的字節數組英寸

+1

+1表示您需要設置「Content-Type」。我完全錯過了,它讓我感到困惑。 – 2012-09-19 19:49:44