org.apache.http.client.fluent.Response.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(110)

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

Response.<init>介绍

暂无

代码示例

代码示例来源:origin: org.apache.httpcomponents/fluent-hc

public Response execute() throws ClientProtocolException, IOException {
  return new Response(internalExecute(Executor.CLIENT, null));
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.apache.httpcomponents.httpclient

public Response execute() throws ClientProtocolException, IOException {
  this.request.setConfig(this.configBuilder.build());
  return new Response(Executor.CLIENT.execute(this.request));
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.apache.httpcomponents.httpclient

/**
 * Executes the request. Please Note that response content must be processed
 * or discarded using {@link Response#discardContent()}, otherwise the
 * connection used for the request might not be released to the pool.
 *
 * @see Response#handleResponse(org.apache.http.client.ResponseHandler)
 * @see Response#discardContent()
 */
public Response execute(
    final Request request) throws ClientProtocolException, IOException {
  final HttpClientContext localContext = HttpClientContext.create();
  localContext.setAttribute(HttpClientContext.CREDS_PROVIDER, this.credentialsProvider);
  localContext.setAttribute(HttpClientContext.AUTH_CACHE, this.authCache);
  localContext.setAttribute(HttpClientContext.COOKIE_STORE, this.cookieStore);
  final InternalHttpRequest httprequest = request.prepareRequest();
  return new Response(this.httpclient.execute(httprequest, localContext));
}

代码示例来源:origin: org.apache.httpcomponents/fluent-hc

/**
 * Executes the request. Please Note that response content must be processed
 * or discarded using {@link Response#discardContent()}, otherwise the
 * connection used for the request might not be released to the pool.
 *
 * @see Response#handleResponse(org.apache.http.client.ResponseHandler)
 * @see Response#discardContent()
 */
public Response execute(
    final Request request) throws ClientProtocolException, IOException {
  final HttpClientContext localContext = HttpClientContext.create();
  if (this.credentialsProvider != null) {
    localContext.setAttribute(HttpClientContext.CREDS_PROVIDER, this.credentialsProvider);
  }
  if (this.authCache != null) {
    localContext.setAttribute(HttpClientContext.AUTH_CACHE, this.authCache);
  }
  if (this.cookieStore != null) {
    localContext.setAttribute(HttpClientContext.COOKIE_STORE, this.cookieStore);
  }
  return new Response(request.internalExecute(this.httpclient, localContext));
}

相关文章