Domanda

I have seen multiple ways to send a file using HttpPost. However, to send a file and other text parameters always seems to require the MultipartEntity object which is in the Apache Http components API.

In the version 4.3, MultipartEntity is deprecated

I have been looking in the documentation, without finding another solution to post multipart data. Either have I here.

I really don't want to use a deprecated object. Any hints?

È stato utile?

Soluzione

Usually, deprecated annotation are accompanied by a note explaining what to use instead. In this case :

Class MultipartEntity
(...)
Deprecated. 
4.3 Use MultipartEntityBuilder.

Which is documented here : http://hc.apache.org/httpcomponents-client-ga/httpmime/apidocs/org/apache/http/entity/mime/MultipartEntityBuilder.html

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top