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

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

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

HttpRequest.stream介绍

[英]Get stream to response body
[中]获取流到响应体

代码示例

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

/**
 * Get response in a buffered stream
 *
 * @see #bufferSize(int)
 * @return stream
 * @throws HttpRequestException
 */
public BufferedInputStream buffer() throws HttpRequestException {
 return new BufferedInputStream(stream(), bufferSize);
}

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

/**
 * Get response in a buffered stream
 *
 * @return stream
 * @throws HttpRequestException
 * @see #bufferSize(int)
 */
public BufferedInputStream buffer() throws HttpRequestException {
  return new BufferedInputStream(stream(), bufferSize);
}

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

/**
 * Get response in a buffered stream
 *
 * @see #bufferSize(int)
 * @return stream
 * @throws HttpRequestException
 */
public BufferedInputStream buffer() throws HttpRequestException {
  return new BufferedInputStream(stream(), bufferSize);
}

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

/**
 * Get response in a buffered stream
 *
 * @see #bufferSize(int)
 * @return stream
 * @throws HttpRequestException
 */
public BufferedInputStream buffer() throws HttpRequestException {
 return new BufferedInputStream(stream(), bufferSize);
}

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

/**
 * Get reader to response body using given character set.
 * <p/>
 * This will fall back to using the UTF-8 character set if the given charset
 * is null
 *
 * @param charset
 * @return reader
 * @throws HttpRequestException
 */
public InputStreamReader reader(final String charset)
    throws HttpRequestException {
  try {
    return new InputStreamReader(stream(), getValidCharset(charset));
  } catch (UnsupportedEncodingException e) {
    throw new HttpRequestException(e);
  }
}

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

/**
 * Get reader to response body using given character set.
 * <p>
 * This will fall back to using the UTF-8 character set if the given charset
 * is null
 *
 * @param charset
 * @return reader
 * @throws HttpRequestException
 */
public InputStreamReader reader(final String charset)
  throws HttpRequestException {
 try {
  return new InputStreamReader(stream(), getValidCharset(charset));
 } catch (UnsupportedEncodingException e) {
  throw new HttpRequestException(e);
 }
}

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

/**
 * Get reader to response body using given character set.
 * <p>
 * This will fall back to using the UTF-8 character set if the given charset
 * is null
 *
 * @param charset
 * @return reader
 * @throws HttpRequestException
 */
public InputStreamReader reader(final String charset)
  throws HttpRequestException {
 try {
  return new InputStreamReader(stream(), getValidCharset(charset));
 } catch (UnsupportedEncodingException e) {
  throw new HttpRequestException(e);
 }
}

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

/**
 * Get reader to response body using given character set.
 * <p>
 * This will fall back to using the UTF-8 character set if the given charset
 * is null
 *
 * @param charset
 * @return reader
 * @throws HttpRequestException
 */
public InputStreamReader reader(final String charset)
    throws HttpRequestException {
  try {
    return new InputStreamReader(stream(), getValidCharset(charset));
  } catch (UnsupportedEncodingException e) {
    throw new HttpRequestException(e);
  }
}

代码示例来源:origin: io.github.livingdocumentation/dot-diagram

@Override
public void render(String filename) throws InterruptedException, IOException {
  String dot = read(path + filename + ".dot");
  HttpRequest httpRequest = HttpRequest.get(GOOGLE_CHART_API, true, "cht", "gv", "chl", dot);
  if (httpRequest.ok()) {
    try (InputStream is = httpRequest.stream()) {
      Files.copy(is, Paths.get(path + filename + getImageExtension()));
    }
  } else {
    throw new DotDiagramException("Errors calling Graphviz chart.googleapis.com");
  }
}

相关文章

HttpRequest类方法