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


Java Method.POST属性代码示例

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


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

示例1: getEsMethod

private Method getEsMethod(final String method) {
    if ("get".equalsIgnoreCase(method)) {
        return Method.GET;
    } else if ("post".equalsIgnoreCase(method)) {
        return Method.POST;
    } else if ("put".equalsIgnoreCase(method)) {
        return Method.PUT;
    } else if ("delete".equalsIgnoreCase(method)) {
        return Method.DELETE;
    } else if ("options".equalsIgnoreCase(method)) {
        return Method.OPTIONS;
    } else if ("head".equalsIgnoreCase(method)) {
        return Method.HEAD;
    }
    return null;
}
 
开发者ID:codelibs,项目名称:elasticsearch-auth,代码行数:16,代码来源:LoginConstraint.java

示例2: generateLocalSearchRequest

private static SearchRequest generateLocalSearchRequest(String source, String indexName, String type) {
    LocalRestRequest localRestRequest = new LocalRestRequest("/_search", Method.POST);
    localRestRequest.setContent(source, null);
    SearchRequest searchRequest = new SearchRequest();
    searchRequest.indices(Strings.splitStringByCommaToArray(indexName));
    // get the content, and put it in the body
    // add content/source as template if template flag is set
    searchRequest.source(localRestRequest.content());
    searchRequest.searchType(SearchType.QUERY_AND_FETCH);
    searchRequest.extraSource(RestSearchAction.parseSearchSource(localRestRequest));
    searchRequest.types(Strings.splitStringByCommaToArray(type));
    searchRequest.putHeader("search_source", "reindex");
    return searchRequest;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:14,代码来源:IndexShard.java

示例3: isNtlmType1PostAuthorizationHeader

/**
 * When using NTLM authentication and the browser is making a POST request, it preemptively sends a Type 2
 * authentication message (without the POSTed data). The server responds with a 401, and the browser sends a Type 3
 * request with the POSTed data. This is to avoid the situation where user's credentials might be potentially
 * invalid, and all this data is being POSTed across the wire.
 * 
 * @return True if request is an NTLM POST or PUT with an Authorization header and no data.
 * @throws AuthException
 */
public boolean isNtlmType1PostAuthorizationHeader() throws AuthException {
    if (this.request.method() != Method.POST && this.request.method() != Method.PUT) {
        return false;
    }

    if (this.request.content() != null && this.request.content().length() > 0) {
        return false;
    }

    return isNtlmType1Message() || isSPNegoMessage();
}
 
开发者ID:petalmd,项目名称:armor,代码行数:20,代码来源:AuthorizationHeader.java


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