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

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

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

HttpRequest.receive介绍

[英]Stream response body to file
[中]流响应主体到文件

代码示例

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

@Override
 protected HttpRequest run() throws HttpRequestException, IOException {
  return receive(output);
 }
}.call();

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

@Override
 protected HttpRequest run() throws HttpRequestException, IOException {
  return receive(output);
 }
}.call();

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

/**
 * Stream response to given print stream
 *
 * @param output
 * @return this request
 * @throws HttpRequestException
 */
public HttpRequest receive(final PrintStream output)
  throws HttpRequestException {
 return receive((OutputStream) output);
}

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

/**
 * Stream response to given print stream
 *
 * @param output
 * @return this request
 * @throws HttpRequestException
 */
public HttpRequest receive(final PrintStream output)
  throws HttpRequestException {
 return receive((OutputStream) output);
}

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

@Override
  protected HttpRequest run() throws HttpRequestException, IOException {
    return receive(output);
  }
}.call();

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

/**
 * Stream response to given print stream
 *
 * @param output
 * @return this request
 * @throws HttpRequestException
 */
public HttpRequest receive(final PrintStream output)
    throws HttpRequestException {
  return receive((OutputStream) output);
}

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

/**
 * Stream response to given print stream
 *
 * @param output
 * @return this request
 * @throws HttpRequestException
 */
public HttpRequest receive(final PrintStream output)
    throws HttpRequestException {
  return receive((OutputStream) output);
}

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

@Override
  protected HttpRequest run() throws HttpRequestException, IOException {
    return receive(output);
  }
}.call();

代码示例来源:origin: stackoverflow.com

HttpRequest request = HttpRequest.post(url);
 request.authorization("Basic "+ah);
 request.part("file", fName+".png", "image/png", new File(file));
 request.part("title", "test");
 if(request.code()==201) {
  StringWriter sw = new StringWriter();
  request.receive(sw);
  onMedia(Media.parse(new  JsonParser().parse(sw.toString()).getAsJsonObject()));
 }

代码示例来源:origin: me.hao0/common

/**
   * download a file
   * @param url http url
   * @param output the output which downloaded content will fill into
   */
  public static void download(String url, OutputStream output){
    try {
      HttpRequest request =  HttpRequest.get(url);
      if (request.ok()){
        request.receive(output);
      } else {
        throw new HttpException("request isn't ok: " + request.body());
      }
    } catch (Exception e){
      throw new HttpException(e);
    }
  }
}

代码示例来源:origin: ihaolin/antares

/**
   * download a file
   * @param url http url
   * @param output the output which downloaded content will fill into
   */
  public static void download(String url, OutputStream output){
    try {
      HttpRequest request =  HttpRequest.get(url);
      if (request.ok()){
        request.receive(output);
      } else {
        throw new HttpException("request isn't ok: " + request.body());
      }
    } catch (Exception e){
      throw new HttpException(e);
    }
  }
}

代码示例来源:origin: ihaolin/common

/**
   * download a file
   * @param url http url
   * @param output the output which downloaded content will fill into
   */
  public static void download(String url, OutputStream output){
    try {
      HttpRequest request =  HttpRequest.get(url);
      if (request.ok()){
        request.receive(output);
      } else {
        throw new HttpException("request isn't ok: " + request.body());
      }
    } catch (Exception e){
      throw new HttpException(e);
    }
  }
}

相关文章

HttpRequest类方法