public class Request
Contains the details of an HTTP request received by the API.
| Constructor and Description |
|---|
Request(HttpMethod method,
java.lang.String path,
Params headers,
Params queryParams,
Params pathParams,
Params context,
java.lang.Object body,
java.util.Map<java.lang.String,? extends java.lang.Object> attributes)
Contains the details of an HTTP request received by the API.
|
| Modifier and Type | Method and Description |
|---|---|
HttpMethod |
component1() |
java.lang.String |
component2() |
Params |
component3() |
Params |
component4() |
Params |
component5() |
Params |
component6() |
java.lang.Object |
component7() |
java.util.Map<java.lang.String,java.lang.Object> |
component8() |
Request |
copy(HttpMethod method,
java.lang.String path,
Params headers,
Params queryParams,
Params pathParams,
Params context,
java.lang.Object body,
java.util.Map<java.lang.String,? extends java.lang.Object> attributes,
java.util.Map<java.lang.String,java.lang.String> defaultResponseHeaders)
Contains the details of an HTTP request received by the API.
|
boolean |
equals(java.lang.Object p) |
java.util.Map<java.lang.String,java.lang.Object> |
getAttributes() |
java.lang.Object |
getBody() |
Params |
getContext() |
Params |
getHeaders() |
HttpMethod |
getMethod() |
java.lang.String |
getPath() |
Params |
getPathParams() |
Params |
getQueryParams() |
int |
hashCode() |
byte[] |
requireBinaryBody()
Returns the body as a byte array or throws
IllegalArgumentException if there is no body or it isn't binary. |
java.lang.Object |
requireBody()
Returns the body or throws
IllegalArgumentException if it is null. |
<T> T |
requireBody(kotlin.reflect.KClass<T> expectedType)
Returns the body or throws
IllegalArgumentException if it is null or not of the expected type. |
ResponseBuilder |
responseBuilder()
Returns a builder for building a response.
|
java.lang.String |
toString() |
Request |
withAttribute(java.lang.String name,
java.lang.Object value)
Returns a copy of this request with the value added to its attributes, keyed by the name.
|
public Request(HttpMethod method, java.lang.String path, Params headers, Params queryParams, Params pathParams, Params context, java.lang.Object body, java.util.Map<java.lang.String,? extends java.lang.Object> attributes)
Contains the details of an HTTP request received by the API.
public java.lang.Object requireBody()
Returns the body or throws IllegalArgumentException if it is null.
public <T> T requireBody(kotlin.reflect.KClass<T> expectedType)
Returns the body or throws IllegalArgumentException if it is null or not of the expected type.
public byte[] requireBinaryBody()
Returns the body as a byte array or throws IllegalArgumentException if there is no body or it isn't binary.
public ResponseBuilder responseBuilder()
Returns a builder for building a response.
This is used to customise the headers or the status of the response.
public Request withAttribute(java.lang.String name, java.lang.Object value)
Returns a copy of this request with the value added to its attributes, keyed by the name.
public HttpMethod getMethod()
public java.lang.String getPath()
public Params getHeaders()
public Params getQueryParams()
public Params getPathParams()
public Params getContext()
public java.lang.Object getBody()
public java.util.Map<java.lang.String,java.lang.Object> getAttributes()
public HttpMethod component1()
public java.lang.String component2()
public Params component3()
public Params component4()
public Params component5()
public Params component6()
public java.lang.Object component7()
public java.util.Map<java.lang.String,java.lang.Object> component8()
public Request copy(HttpMethod method, java.lang.String path, Params headers, Params queryParams, Params pathParams, Params context, java.lang.Object body, java.util.Map<java.lang.String,? extends java.lang.Object> attributes, java.util.Map<java.lang.String,java.lang.String> defaultResponseHeaders)
Contains the details of an HTTP request received by the API.
public java.lang.String toString()
public int hashCode()
public boolean equals(java.lang.Object p)