當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。