I want to upload a file (an image specifically) to a REST Server using HTTP POST
. I have already imported/add to build path httpmime-4.3.1.jar
and
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