本文整理匯總了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"));
}
示例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);
}
}
示例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;
}
示例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;
}
示例5: ProgressMultipartEntity
public ProgressMultipartEntity(ArtHttpListener listener) {
this(HttpMultipartMode.STRICT, listener);
}