문제

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?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top