R
- the entity return typepublic class HttpRequest<R> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
HttpRequest.RequestBuilder<R> |
Constructor and Description |
---|
HttpRequest() |
HttpRequest(String endpoint,
String path,
HttpMethod method,
ModelEntity entity,
Class<R> returnType)
Creates a new HttpRequest
|
Modifier and Type | Method and Description |
---|---|
static HttpRequest.RequestBuilder<Void> |
builder()
A build for creating HttpRequest objects
|
static <R> HttpRequest.RequestBuilder<R> |
builder(Class<R> returnType)
A build for creating HttpRequest objects
|
Config |
getConfig() |
String |
getContentType() |
String |
getEndpoint() |
Object |
getEntity() |
Map<String,Object> |
getHeaders() |
String |
getJson()
If JSON is explicitly set vs an entity then this method will return a JSON String otherwise Empty
|
HttpMethod |
getMethod() |
String |
getPath() |
Map<String,List<Object>> |
getQueryParams() |
Class<R> |
getReturnType() |
boolean |
hasHeaders() |
boolean |
hasJson() |
boolean |
hasQueryParams() |
HttpRequest.RequestBuilder<R> |
toBuilder() |
public HttpRequest()
public HttpRequest(String endpoint, String path, HttpMethod method, ModelEntity entity, Class<R> returnType)
endpoint
- the endpoint URIpath
- the path which will be appended to the endpoint URImethod
- the method the method type to invokeentity
- the entity (used for posts)returnType
- the expected return typepublic static HttpRequest.RequestBuilder<Void> builder()
public static <R> HttpRequest.RequestBuilder<R> builder(Class<R> returnType)
R
- the expected return typereturnType
- the return typepublic HttpMethod getMethod()
public String getContentType()
public String getEndpoint()
public String getPath()
public String getJson()
public boolean hasJson()
public Object getEntity()
public boolean hasQueryParams()
public boolean hasHeaders()
public HttpRequest.RequestBuilder<R> toBuilder()
public Config getConfig()
Copyright © 2017. All rights reserved.