Upload file by HTTP POST

[亡魂溺海] 提交于 2019-12-01 00:53:57

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!