當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。