Class ApiJsonRequest<T extends ApiJsonRequest<T>>
java.lang.Object
io.helidon.integrations.common.rest.ApiJsonBuilder<T>
io.helidon.integrations.common.rest.ApiJsonRequest<T>
- Type Parameters:
T
- type of the request
- All Implemented Interfaces:
ApiRequest<T>
- Direct Known Subclasses:
JsonRequest
,VaultRequest
public abstract class ApiJsonRequest<T extends ApiJsonRequest<T>>
extends ApiJsonBuilder<T>
implements ApiRequest<T>
Common base class for REST requests that have an entity.
This class acts as a mutable builder of request JSON object.
Path is not a part of this request.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdd an HTTP header.addQueryParam
(String name, String... value) Add an HTTP query parameter.headers()
Returns immutable configured headers.Returns immutable configured query parameters.Configured request ID.Configure request ID for logging (and possibly to send over the network).Request media type.requestMediaType
(MediaType mediaType) The media type header, defaults toMediaType.APPLICATION_JSON
when JSON entity is present, toMediaType.APPLICATION_OCTET_STREAM
for publisher base requests, empty otherwise.Response media type.responseMediaType
(MediaType mediaType) The accept header, defaults toMediaType.APPLICATION_JSON
for most requests, except for requests that return publisher, which default toMediaType.APPLICATION_OCTET_STREAM
.Methods inherited from class io.helidon.integrations.common.rest.ApiJsonBuilder
add, add, add, add, add, add, addBase64, addToArray, addToArray, addToArray, addToArray, addToArray, addToArray, addToObject, addToObject, addToObject, addToObject, addToObject, emptyArray, me, postBuild, preBuild, toJson
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.helidon.integrations.common.rest.ApiRequest
toJson
-
Constructor Details
-
ApiJsonRequest
protected ApiJsonRequest()Default constructor.
-
-
Method Details
-
addHeader
Add an HTTP header.- Specified by:
addHeader
in interfaceApiRequest<T extends ApiJsonRequest<T>>
- Parameters:
name
- name of the headervalue
- header value(s)- Returns:
- updated request
-
addQueryParam
Add an HTTP query parameter.- Specified by:
addQueryParam
in interfaceApiRequest<T extends ApiJsonRequest<T>>
- Parameters:
name
- name of the parametervalue
- parameter value(s)- Returns:
- updated request
-
headers
Returns immutable configured headers.- Specified by:
headers
in interfaceApiRequest<T extends ApiJsonRequest<T>>
- Returns:
- headers configured for this request
-
queryParams
Returns immutable configured query parameters.- Specified by:
queryParams
in interfaceApiRequest<T extends ApiJsonRequest<T>>
- Returns:
- query parameters configured for this request
-
requestMediaType
Description copied from interface:ApiRequest
The media type header, defaults toMediaType.APPLICATION_JSON
when JSON entity is present, toMediaType.APPLICATION_OCTET_STREAM
for publisher base requests, empty otherwise.- Specified by:
requestMediaType
in interfaceApiRequest<T extends ApiJsonRequest<T>>
- Parameters:
mediaType
- media type of request- Returns:
- updated request
-
responseMediaType
Description copied from interface:ApiRequest
The accept header, defaults toMediaType.APPLICATION_JSON
for most requests, except for requests that return publisher, which default toMediaType.APPLICATION_OCTET_STREAM
.- Specified by:
responseMediaType
in interfaceApiRequest<T extends ApiJsonRequest<T>>
- Parameters:
mediaType
- accepted media type- Returns:
- updated request
-
requestId
Description copied from interface:ApiRequest
Configure request ID for logging (and possibly to send over the network).- Specified by:
requestId
in interfaceApiRequest<T extends ApiJsonRequest<T>>
- Parameters:
requestId
- request id- Returns:
- updated request
-
requestMediaType
Description copied from interface:ApiRequest
Request media type.- Specified by:
requestMediaType
in interfaceApiRequest<T extends ApiJsonRequest<T>>
- Returns:
- media type if configured
- See Also:
-
responseMediaType
Description copied from interface:ApiRequest
Response media type.- Specified by:
responseMediaType
in interfaceApiRequest<T extends ApiJsonRequest<T>>
- Returns:
- media type if configured
- See Also:
-
requestId
Description copied from interface:ApiRequest
Configured request ID.- Specified by:
requestId
in interfaceApiRequest<T extends ApiJsonRequest<T>>
- Returns:
- request ID if configured
-