MultipartEntityBuilder包org.apache.http.entity.mime不存在

时间:2018-05-04 16:26:02

标签: http file-upload apache-camel multipartform-data

我正在尝试使用MultipartEntityBuilder,跟随http://hilton.org.uk/blog/camel-multipart-form-data博客使用Camel进行多部分表单编码,但是当我编译它时说包不存在?我在https://hc.apache.org/httpcomponents-client-ga/httpmime/apidocs/org/apache/http/entity/mime/MultipartEntityBuilder.html

上看到了

有谁知道解决方案?谢谢!

import java.lang.StringBuilder;
import java.net.URLEncoder;
import java.util.Base64;

import org.apache.camel.Exchange;
import org.apache.camel.Message;
import org.apache.camel.Processor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.camel.LoggingLevel;
import org.apache.http.entity.mime.MultipartEntityBuilder;

编译给出

java:[13,35] error: package org.apache.http.entity.mime does not exist

1 个答案:

答案 0 :(得分:0)

发现需要maven依赖。

将此添加到我的POM后,它现在编译无怨言。

true