本文整理汇总了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);
}