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

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

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

HttpRequest.startPart介绍

[英]Start part of a multipart
[中]多部分的开始部分

代码示例

代码示例来源:origin: com.github.kevinsawicki/http-request

/**
 * Write part of a multipart request to the request body
 *
 * @param name
 * @param filename
 * @param contentType
 *          value of the Content-Type part header
 * @param part
 * @return this request
 * @throws HttpRequestException
 */
public HttpRequest part(final String name, final String filename,
  final String contentType, final InputStream part)
  throws HttpRequestException {
 try {
  startPart();
  writePartHeader(name, filename, contentType);
  copy(part, output);
 } catch (IOException e) {
  throw new HttpRequestException(e);
 }
 return this;
}

代码示例来源:origin: lkorth/httpebble-android

/**
 * Write part of a multipart request to the request body
 *
 * @param name
 * @param filename
 * @param contentType value of the Content-Type part header
 * @param part
 * @return this request
 * @throws HttpRequestException
 */
public HttpRequest part(final String name, final String filename,
            final String contentType, final String part) throws HttpRequestException {
  try {
    startPart();
    writePartHeader(name, filename, contentType);
    output.write(part);
  } catch (IOException e) {
    throw new HttpRequestException(e);
  }
  return this;
}

代码示例来源:origin: com.github.kevinsawicki/http-request

/**
 * Write part of a multipart request to the request body
 *
 * @param name
 * @param filename
 * @param contentType
 *          value of the Content-Type part header
 * @param part
 * @return this request
 * @throws HttpRequestException
 */
public HttpRequest part(final String name, final String filename,
  final String contentType, final String part) throws HttpRequestException {
 try {
  startPart();
  writePartHeader(name, filename, contentType);
  output.write(part);
 } catch (IOException e) {
  throw new HttpRequestException(e);
 }
 return this;
}

代码示例来源:origin: lkorth/httpebble-android

/**
 * Write part of a multipart request to the request body
 *
 * @param name
 * @param filename
 * @param contentType value of the Content-Type part header
 * @param part
 * @return this request
 * @throws HttpRequestException
 */
public HttpRequest part(final String name, final String filename,
            final String contentType, final InputStream part)
    throws HttpRequestException {
  try {
    startPart();
    writePartHeader(name, filename, contentType);
    copy(part, output);
  } catch (IOException e) {
    throw new HttpRequestException(e);
  }
  return this;
}

代码示例来源:origin: tcking/GiraffePlayer2

/**
 * Write part of a multipart request to the request body
 *
 * @param name
 * @param filename
 * @param contentType
 *          value of the Content-Type part header
 * @param part
 * @return this request
 * @throws HttpRequestException
 */
public HttpRequest part(final String name, final String filename,
            final String contentType, final String part) throws HttpRequestException {
  try {
    startPart();
    writePartHeader(name, filename, contentType);
    output.write(part);
  } catch (IOException e) {
    throw new HttpRequestException(e);
  }
  return this;
}

代码示例来源:origin: com.restfuse/com.eclipsesource.restfuse

/**
 * Write part of a multipart request to the request body
 *
 * @param name
 * @param filename
 * @param contentType
 *          value of the Content-Type part header
 * @param part
 * @return this request
 * @throws HttpRequestException
 */
public HttpRequest part(final String name, final String filename,
  final String contentType, final String part) throws HttpRequestException {
 try {
  startPart();
  writePartHeader(name, filename, contentType);
  output.write(part);
 } catch (IOException e) {
  throw new HttpRequestException(e);
 }
 return this;
}

代码示例来源:origin: tcking/GiraffePlayer2

/**
 * Write part of a multipart request to the request body
 *
 * @param name
 * @param filename
 * @param contentType
 *          value of the Content-Type part header
 * @param part
 * @return this request
 * @throws HttpRequestException
 */
public HttpRequest part(final String name, final String filename,
            final String contentType, final InputStream part)
    throws HttpRequestException {
  try {
    startPart();
    writePartHeader(name, filename, contentType);
    copy(part, output);
  } catch (IOException e) {
    throw new HttpRequestException(e);
  }
  return this;
}

代码示例来源:origin: com.restfuse/com.eclipsesource.restfuse

/**
 * Write part of a multipart request to the request body
 *
 * @param name
 * @param filename
 * @param contentType
 *          value of the Content-Type part header
 * @param part
 * @return this request
 * @throws HttpRequestException
 */
public HttpRequest part(final String name, final String filename,
  final String contentType, final InputStream part)
  throws HttpRequestException {
 try {
  startPart();
  writePartHeader(name, filename, contentType);
  copy(part, output);
 } catch (IOException e) {
  throw new HttpRequestException(e);
 }
 return this;
}

相关文章

微信公众号

最新文章

更多

HttpRequest类方法