Example usage for org.apache.http.client.methods HttpGetWithEntity METHOD_NAME

List of usage examples for org.apache.http.client.methods HttpGetWithEntity METHOD_NAME

Introduction

In this page you can find the example usage for org.apache.http.client.methods HttpGetWithEntity METHOD_NAME.

Prototype

String METHOD_NAME

To view the source code for org.apache.http.client.methods HttpGetWithEntity METHOD_NAME.

Click Source Link

Usage

From source file:org.elasticsearch.test.rest.client.http.HttpRequestBuilder.java

private HttpUriRequest buildRequest() {

    if (HttpGetWithEntity.METHOD_NAME.equalsIgnoreCase(method)) {
        return addOptionalBody(new HttpGetWithEntity(buildUri()));
    }/*from   w ww.  j  a  v  a  2 s . c o  m*/

    if (HttpHead.METHOD_NAME.equalsIgnoreCase(method)) {
        checkBodyNotSupported();
        return new HttpHead(buildUri());
    }

    if (HttpDeleteWithEntity.METHOD_NAME.equalsIgnoreCase(method)) {
        return addOptionalBody(new HttpDeleteWithEntity(buildUri()));
    }

    if (HttpPut.METHOD_NAME.equalsIgnoreCase(method)) {
        return addOptionalBody(new HttpPut(buildUri()));
    }

    if (HttpPost.METHOD_NAME.equalsIgnoreCase(method)) {
        return addOptionalBody(new HttpPost(buildUri()));
    }

    throw new UnsupportedOperationException("method [" + method + "] not supported");
}