本文整理汇总了Java中com.koushikdutta.async.http.Headers.set方法的典型用法代码示例。如果您正苦于以下问题:Java Headers.set方法的具体用法?Java Headers.set怎么用?Java Headers.set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.koushikdutta.async.http.Headers
的用法示例。
在下文中一共展示了Headers.set方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Part
import com.koushikdutta.async.http.Headers; //导入方法依赖的package包/类
public Part(String name, long length, List<NameValuePair> contentDisposition) {
this.length = length;
mHeaders = new Headers();
StringBuilder builder = new StringBuilder(String.format(Locale.ENGLISH, "form-data; name=\"%s\"", name));
if (contentDisposition != null) {
for (NameValuePair pair: contentDisposition) {
builder.append(String.format(Locale.ENGLISH, "; %s=\"%s\"", pair.getName(), pair.getValue()));
}
}
mHeaders.set(CONTENT_DISPOSITION, builder.toString());
mContentDisposition = Multimap.parseSemicolonDelimited(mHeaders.get(CONTENT_DISPOSITION));
}
示例2: Part
import com.koushikdutta.async.http.Headers; //导入方法依赖的package包/类
public Part(String name, long length, List<NameValuePair> contentDisposition) {
this.length = length;
mHeaders = new Headers();
StringBuilder builder = new StringBuilder(String.format("form-data; name=\"%s\"", name));
if (contentDisposition != null) {
for (NameValuePair pair: contentDisposition) {
builder.append(String.format("; %s=\"%s\"", pair.getName(), pair.getValue()));
}
}
mHeaders.set(CONTENT_DISPOSITION, builder.toString());
mContentDisposition = Multimap.parseSemicolonDelimited(mHeaders.get(CONTENT_DISPOSITION));
}
示例3: setHeaders
import com.koushikdutta.async.http.Headers; //导入方法依赖的package包/类
public void setHeaders(Headers paramHeaders) {
paramHeaders.set("contentFeatures.dlna.org", this.dlnaContentFeatures);
paramHeaders.set("TransferMode.DLNA.ORG", this.dlnaTransferMode);
paramHeaders.set("DAAP-Server", "iTunes/11.0.5 (OS X)");
paramHeaders.set("Date", HttpDate.format(new Date()));
paramHeaders.set("Last-Modified", "2015-01-01T10:00:00Z");
paramHeaders.set("Content-Type", this.mimeType);
paramHeaders.set("CaptionInfo.sec", getSubsURL(SRT));
}