com.github.kevinsawicki.http.HttpRequest.partHeader()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(142)

本文整理了Java中com.github.kevinsawicki.http.HttpRequest.partHeader()方法的一些代码示例,展示了HttpRequest.partHeader()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpRequest.partHeader()方法的具体详情如下:
包路径:com.github.kevinsawicki.http.HttpRequest
类名称:HttpRequest
方法名:partHeader

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);
}

相关文章

HttpRequest类方法