本文整理汇总了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;
}
示例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;
}
示例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();
}