本文整理了Java中com.github.kevinsawicki.http.HttpRequest.receive()
方法的一些代码示例,展示了HttpRequest.receive()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpRequest.receive()
方法的具体详情如下:
包路径:com.github.kevinsawicki.http.HttpRequest
类名称: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);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!