org.apache.http.client.fluent.Request.Head()方法的使用及代码示例

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

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

Request.Head介绍

暂无

代码示例

代码示例来源:origin: dreamhead/moco

public HttpResponse headForResponse(final String url) throws IOException {
  return execute(Request.Head(url));
}

代码示例来源:origin: jooby-project/jooby

public Request head(final String path) {
 this.req = new Request(this, executor(), org.apache.http.client.fluent.Request.Head(host
   + path));
 return req;
}

代码示例来源:origin: dreamhead/moco

@Override
  public void run() throws IOException {
    assertThat(helper.get(remoteUrl("/proxy")), is("get_proxy"));
    assertThat(helper.postContent(remoteUrl("/proxy"), "proxy"), is("post_proxy"));
    Request putRequest = Request.Put(remoteUrl("/proxy")).bodyString("proxy", ContentType.DEFAULT_TEXT);
    assertThat(helper.executeAsString(putRequest), is("put_proxy"));
    Request deleteRequest = Request.Delete(remoteUrl("/proxy"));
    assertThat(helper.executeAsString(deleteRequest), is("delete_proxy"));
    Request headRequest = Request.Head(remoteUrl("/proxy"));
    StatusLine headStatusLine = helper.execute(headRequest).getStatusLine();
    assertThat(headStatusLine.getStatusCode(), is(200));
    Request optionsRequest = Request.Options(remoteUrl("/proxy"));
    assertThat(helper.executeAsString(optionsRequest), is("options_proxy"));
    Request traceRequest = Request.Trace(remoteUrl("/proxy"));
    assertThat(helper.executeAsString(traceRequest), is("trace_proxy"));
  }
});

代码示例来源:origin: UNIVALI-LITE/Portugol-Studio

String a = Request.Head(endereco).connectTimeout(timeout).execute().returnResponse().toString();
if(a.contains("404 Not Found")){
  return false;

代码示例来源:origin: UNIVALI-LITE/Portugol-Studio

headerDaRequisicao = Request.Head(endereco).connectTimeout(timeout).execute().returnResponse().toString();
if(headerDaRequisicao.contains("Content-Type: image/png")){
  tipo_da_imagem = "png";

代码示例来源:origin: rancher/cattle

break;
case "HEAD":
  temp = Request.Head(redirect);
  break;
default:

相关文章