本文整理了Java中com.github.kevinsawicki.http.HttpRequest.partHeader()
方法的一些代码示例,展示了HttpRequest.partHeader()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpRequest.partHeader()
方法的具体详情如下:
包路径:com.github.kevinsawicki.http.HttpRequest
类名称:HttpRequest
方法名:partHeader
[英]Write a multipart header to the response body
[中]将多部分头写入响应正文
代码示例来源:origin: com.github.kevinsawicki/http-request
/**
* Write part header
*
* @param name
* @param filename
* @param contentType
* @return this request
* @throws IOException
*/
protected HttpRequest writePartHeader(final String name,
final String filename, final String contentType) throws IOException {
final StringBuilder partBuffer = new StringBuilder();
partBuffer.append("form-data; name=\"").append(name);
if (filename != null)
partBuffer.append("\"; filename=\"").append(filename);
partBuffer.append('"');
partHeader("Content-Disposition", partBuffer.toString());
if (contentType != null)
partHeader(HEADER_CONTENT_TYPE, contentType);
return send(CRLF);
}
代码示例来源:origin: tcking/GiraffePlayer2
/**
* Write part header
*
* @param name
* @param filename
* @param contentType
* @return this request
* @throws IOException
*/
protected HttpRequest writePartHeader(final String name,
final String filename, final String contentType) throws IOException {
final StringBuilder partBuffer = new StringBuilder();
partBuffer.append("form-data; name=\"").append(name);
if (filename != null)
partBuffer.append("\"; filename=\"").append(filename);
partBuffer.append('"');
partHeader("Content-Disposition", partBuffer.toString());
if (contentType != null)
partHeader(HEADER_CONTENT_TYPE, contentType);
return send(CRLF);
}
代码示例来源:origin: com.restfuse/com.eclipsesource.restfuse
/**
* Write part header
*
* @param name
* @param filename
* @param contentType
* @return this request
* @throws IOException
*/
protected HttpRequest writePartHeader(final String name,
final String filename, final String contentType) throws IOException {
final StringBuilder partBuffer = new StringBuilder();
partBuffer.append("form-data; name=\"").append(name);
if (filename != null)
partBuffer.append("\"; filename=\"").append(filename);
partBuffer.append('"');
partHeader("Content-Disposition", partBuffer.toString());
if (contentType != null)
partHeader(HEADER_CONTENT_TYPE, contentType);
return send(CRLF);
}
代码示例来源:origin: lkorth/httpebble-android
/**
* Write part header
*
* @param name
* @param filename
* @param contentType
* @return this request
* @throws IOException
*/
protected HttpRequest writePartHeader(final String name,
final String filename, final String contentType) throws IOException {
final StringBuilder partBuffer = new StringBuilder();
partBuffer.append("form-data; name=\"").append(name);
if (filename != null)
partBuffer.append("\"; filename=\"").append(filename);
partBuffer.append('"');
partHeader("Content-Disposition", partBuffer.toString());
if (contentType != null)
partHeader(HEADER_CONTENT_TYPE, contentType);
return send(CRLF);
}
内容来源于网络,如有侵权,请联系作者删除!