Package org.refcodes.net
Interface HttpClientRequest
-
- All Superinterfaces:
HeaderFieldsAccessor<RequestHeaderFields>
,HttpBodyAccessor.HttpBodyProvider<BadRequestException>
,HttpMethodAccessor
,HttpRequest
,UrlAccessor
- All Known Implementing Classes:
HttpClientRequestImpl
public interface HttpClientRequest extends HttpRequest, HttpBodyAccessor.HttpBodyProvider<BadRequestException>
Defines aHttpClientRequest
being the request as produced by the client.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.net.HeaderFieldsAccessor
HeaderFieldsAccessor.HeaderFieldsBuilder<T extends HeaderFields<?,?>,B extends HeaderFieldsAccessor.HeaderFieldsBuilder<T,B>>, HeaderFieldsAccessor.HeaderFieldsMutator<T extends HeaderFields<?,?>>, HeaderFieldsAccessor.HeaderFieldsProperty<T extends HeaderFields<?,?>>
-
Nested classes/interfaces inherited from interface org.refcodes.net.HttpMethodAccessor
HttpMethodAccessor.HttpMethodBuilder<B extends HttpMethodAccessor.HttpMethodBuilder<B>>, HttpMethodAccessor.HttpMethodMutator, HttpMethodAccessor.HttpMethodProperty
-
Nested classes/interfaces inherited from interface org.refcodes.net.UrlAccessor
UrlAccessor.UrlBuilder, UrlAccessor.UrlMutator, UrlAccessor.UrlProperty
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description <REQ> REQ
getRequest()
Retrieves the request from the request property.<REQ> void
setRequest(REQ aRequest)
Sets the request for the request property.java.lang.String
toHttpBody()
Automatically sets theContentType
to theRequestHeaderFields
retrieved fromHeaderFieldsAccessor.getHeaderFields()
.default <REQ> HttpClientRequest
withRequest(REQ aRequest)
Sets the request for the request property.-
Methods inherited from interface org.refcodes.net.HeaderFieldsAccessor
getHeaderFields
-
Methods inherited from interface org.refcodes.net.HttpMethodAccessor
getHttpMethod
-
Methods inherited from interface org.refcodes.net.UrlAccessor
getUrl
-
-
-
-
Method Detail
-
toHttpBody
java.lang.String toHttpBody() throws BadRequestException
Automatically sets theContentType
to theRequestHeaderFields
retrieved fromHeaderFieldsAccessor.getHeaderFields()
. (seeHeaderFields.putContentType(org.refcodes.net.HttpMediaType)
) Converts an object representing the HTTP body to aString
instance. Automatically determines theContentType
from any headers when applicable.- Specified by:
toHttpBody
in interfaceHttpBodyAccessor.HttpBodyProvider<BadRequestException>
- Returns:
- The converted
String
instance represented by the according object. - Throws:
BadRequestException
-
getRequest
<REQ> REQ getRequest()
Retrieves the request from the request property.- Type Parameters:
REQ
- the generic type- Returns:
- The request stored by the request property.
-
setRequest
<REQ> void setRequest(REQ aRequest)
Sets the request for the request property. TheHttpClientRequestImpl.setRequest(Object)
supports theHttpBodyMap
to marshal anHttpBodyMap
into an HTTP Request-Body.- Type Parameters:
REQ
- the generic type- Parameters:
aRequest
- The request to be stored by the request property.
-
withRequest
default <REQ> HttpClientRequest withRequest(REQ aRequest)
Sets the request for the request property.- Type Parameters:
REQ
- the generic type- Parameters:
aRequest
- The request to be stored by the request property.- Returns:
- The builder for applying multiple build operations.
-
-