当前位置: 首页>>代码示例>>Java>>正文


Java HttpHead.METHOD_NAME属性代码示例

本文整理汇总了Java中org.apache.http.client.methods.HttpHead.METHOD_NAME属性的典型用法代码示例。如果您正苦于以下问题:Java HttpHead.METHOD_NAME属性的具体用法?Java HttpHead.METHOD_NAME怎么用?Java HttpHead.METHOD_NAME使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.http.client.methods.HttpHead的用法示例。


在下文中一共展示了HttpHead.METHOD_NAME属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createHttpRequest

private static HttpRequestBase createHttpRequest(String method, URI uri, HttpEntity entity) {
    switch(method.toUpperCase(Locale.ROOT)) {
        case HttpDeleteWithEntity.METHOD_NAME:
            return addRequestBody(new HttpDeleteWithEntity(uri), entity);
        case HttpGetWithEntity.METHOD_NAME:
            return addRequestBody(new HttpGetWithEntity(uri), entity);
        case HttpHead.METHOD_NAME:
            return addRequestBody(new HttpHead(uri), entity);
        case HttpOptions.METHOD_NAME:
            return addRequestBody(new HttpOptions(uri), entity);
        case HttpPatch.METHOD_NAME:
            return addRequestBody(new HttpPatch(uri), entity);
        case HttpPost.METHOD_NAME:
            HttpPost httpPost = new HttpPost(uri);
            addRequestBody(httpPost, entity);
            return httpPost;
        case HttpPut.METHOD_NAME:
            return addRequestBody(new HttpPut(uri), entity);
        case HttpTrace.METHOD_NAME:
            return addRequestBody(new HttpTrace(uri), entity);
        default:
            throw new UnsupportedOperationException("http method not supported: " + method);
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:24,代码来源:RestClient.java

示例2: HttpRedirect

public HttpRedirect(final String method, final URI uri) {
  super();
  if (method.equalsIgnoreCase(HttpHead.METHOD_NAME)) {
    this.method = HttpHead.METHOD_NAME;
  } else {
    this.method = HttpGet.METHOD_NAME;
  }
  setURI(uri);
}
 
开发者ID:qx,项目名称:FullRobolectricTestSample,代码行数:9,代码来源:HttpRedirect.java

示例3: HttpRedirect

public HttpRedirect(final String method, final URI uri) {
    super();
    if (method.equalsIgnoreCase(HttpHead.METHOD_NAME)) {
        this.method = HttpHead.METHOD_NAME;
    } else {
        this.method = HttpGet.METHOD_NAME;
    }
    setURI(uri);
}
 
开发者ID:tdopires,项目名称:cJUnit-mc626,代码行数:9,代码来源:HttpRedirect.java

示例4: exists

static Request exists(GetRequest getRequest) {
    Request request = get(getRequest);
    return new Request(HttpHead.METHOD_NAME, request.endpoint, request.params, null);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:4,代码来源:Request.java

示例5: ping

static Request ping() {
    return new Request(HttpHead.METHOD_NAME, "/", Collections.emptyMap(), null);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:3,代码来源:Request.java

示例6: Head

public static Request Head(final URI uri) {
    return new Request(new InternalHttpRequest(HttpHead.METHOD_NAME, uri));
}
 
开发者ID:MyPureCloud,项目名称:purecloud-iot,代码行数:3,代码来源:Request.java

示例7: getHttpMethod

@Override
public String getHttpMethod() {
    return HttpHead.METHOD_NAME;
}
 
开发者ID:blacklocus,项目名称:jres,代码行数:4,代码来源:JresTypeExists.java


注:本文中的org.apache.http.client.methods.HttpHead.METHOD_NAME属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。