Class HttpRequest
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.driver.HttpRequest
-
public class HttpRequest extends Object
HttpRequest represents the data that will be used to create the actual request to the remote endpoint. It will be passed to differentRequestInterceptorthat can update its values. The body can be anything as the interceptor may change what the payload is. Also contains some convenience Strings for common HTTP header key and values and HTTP methods.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHttpRequest.Headersstatic classHttpRequest.Method
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetBody()Get the body of the request.StringgetMethod()Get the HTTP method of the request.URIgetUri()Get the URI of the request.Map<String,String>headers()Get the headers of the request.HttpRequestsetBody(Object body)Set the HTTP body of the request.HttpRequestsetMethod(String method)Set the HTTP method of the request.HttpRequestsetUri(URI uri)Set the URI of the request.
-
-
-
Method Detail
-
headers
public Map<String,String> headers()
Get the headers of the request.- Returns:
- a map of headers. This can be used to directly update the entries.
-
getBody
public Object getBody()
Get the body of the request.- Returns:
- an Object representing the body.
-
getUri
public URI getUri()
Get the URI of the request.- Returns:
- the request URI.
-
getMethod
public String getMethod()
Get the HTTP method of the request. The standard/gremlinendpoint only supportsPOST.- Returns:
- the HTTP method.
-
setBody
public HttpRequest setBody(Object body)
Set the HTTP body of the request. During processing, the body can be any type but the final interceptor must set the body to abyte[].- Returns:
- this HttpRequest for method chaining.
-
setMethod
public HttpRequest setMethod(String method)
Set the HTTP method of the request.- Returns:
- this HttpRequest for method chaining.
-
setUri
public HttpRequest setUri(URI uri)
Set the URI of the request.- Returns:
- this HttpRequest for method chaining.
-
-