You seem to be missing a dependency.I have httpclient-4.2.5, httpcleint-cache-4.2.5, httpcore-4.2.4 and httpmime-4.2.5 with commons-lang3-3.1 and commons-logging-1.1.2 jars in my class path.I also use entity.addPart(formFieldName, new FileBody(file, "image/jpeg")); instead of using the header property.Take a look at Internet media type for more details解决了。缺少依赖,从官网下载httpclient.zip,把里面的所有jar包都引用进去就OK了。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货