当前位置: 首页>>代码示例>>Java>>正文


Java HttpMultipartMode.STRICT属性代码示例

本文整理汇总了Java中org.apache.http.entity.mime.HttpMultipartMode.STRICT属性的典型用法代码示例。如果您正苦于以下问题:Java HttpMultipartMode.STRICT属性的具体用法?Java HttpMultipartMode.STRICT怎么用?Java HttpMultipartMode.STRICT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.http.entity.mime.HttpMultipartMode的用法示例。


在下文中一共展示了HttpMultipartMode.STRICT属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: STAPIParameters4Post

public STAPIParameters4Post() {
	super();
	mBoundary = getBoundary();
	multiPart = new MultipartEntity(HttpMultipartMode.STRICT, mBoundary, Charset.forName("UTF-8"));
}
 
开发者ID:SenseTimeApp,项目名称:STAPI-Android,代码行数:5,代码来源:STAPIParameters4Post.java

示例2: adaptMultipartMode

private static HttpMultipartMode adaptMultipartMode(MultipartMode mode) {
    switch (mode) {
        case STRICT: return HttpMultipartMode.STRICT;
        case BROWSER_COMPATIBLE: return HttpMultipartMode.BROWSER_COMPATIBLE;
        case RFC6532: return HttpMultipartMode.RFC6532;
        default: throw new IllegalArgumentException("Unknown multipart mode: " + mode);
    }
}
 
开发者ID:mercadolibre,项目名称:java-restclient,代码行数:8,代码来源:HTTPCUtil.java

示例3: buildHttpPost

private HttpPost buildHttpPost(String fileNameWithPath, String product)
{
    HttpPost httpPost = new HttpPost(LogUtil.getInstance().getLogUrl());
    MultipartEntity mutiEntity = new MultipartEntity(HttpMultipartMode.STRICT);
    httpPost.setEntity(mutiEntity);
    File file = new File(fileNameWithPath);
    try
    {
        mutiEntity.addPart("LogFileInfo",
            new StringBody("{\"product\":\"" + product + "\"}", Charset.forName("UTF-8")));
    }
    catch (UnsupportedEncodingException e)
    {
        LogUtil.runLog(LogUtil.errorLogType, "LogFileUploaderTask", "UTF-8 is not supported encode");
        //LOGGER.error("UTF-8 is not supported encode");
    }
    mutiEntity.addPart("LogFile", new FileBody(file));
    return httpPost;
}
 
开发者ID:Huawei,项目名称:eSDK_FC_SDK_Java,代码行数:19,代码来源:LogFileUploaderTask.java

示例4: buildHttpPost

private HttpPost buildHttpPost(String fileNameWithPath, String product)
{
    HttpPost httpPost = new HttpPost(serverUrl);
    MultipartEntity mutiEntity = new MultipartEntity(HttpMultipartMode.STRICT);
    httpPost.setEntity(mutiEntity);
    File file = new File(fileNameWithPath);
    try
    {
        mutiEntity.addPart("LogFileInfo",
            new StringBody("{\"product\":\"" + product + "\"}", Charset.forName("UTF-8")));
    }
    catch (UnsupportedEncodingException e)
    {
        logUtil.showRunningtLog(LOG_TYPE_E.LOG_ERROR, "LogFileUploadTask.buildHttpPost()", "UTF-8 is not supported encode");
    }
    mutiEntity.addPart("LogFile", new FileBody(file));
    return httpPost;
}
 
开发者ID:Huawei,项目名称:eSDK_OpenApi_Windows_Java,代码行数:18,代码来源:LogFileUploadTask.java

示例5: ProgressMultipartEntity

public ProgressMultipartEntity(ArtHttpListener listener) {
    this(HttpMultipartMode.STRICT, listener);
}
 
开发者ID:FingerArt,项目名称:ApiDebugger,代码行数:3,代码来源:ProgressMultipartEntity.java


注:本文中的org.apache.http.entity.mime.HttpMultipartMode.STRICT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。