Package org.refcodes.net
Interface HttpClientRequest
-
- All Superinterfaces:
HeaderFieldsAccessor<RequestHeaderFields>
,HttpBodyAccessor.HttpBodyProvider<BadRequestException>
,HttpMethodAccessor
,HttpRequest
,RedirectDepthAccessor
,RedirectDepthAccessor.RedirectDepthMutator
,RedirectDepthAccessor.RedirectDepthProperty
,UrlAccessor
- All Known Subinterfaces:
HttpClientRequest.HttpClientRequestBuilder
- All Known Implementing Classes:
HttpClientRequestImpl
public interface HttpClientRequest extends HttpRequest, HttpBodyAccessor.HttpBodyProvider<BadRequestException>, RedirectDepthAccessor.RedirectDepthProperty
Defines aHttpClientRequest
being the request as produced by the client.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
HttpClientRequest.HttpClientRequestBuilder
Builder for theHttpClientRequest
interface.-
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.RedirectDepthAccessor
RedirectDepthAccessor.RedirectDepthBuilder<B extends RedirectDepthAccessor.RedirectDepthBuilder<B>>, RedirectDepthAccessor.RedirectDepthMutator, RedirectDepthAccessor.RedirectDepthProperty
-
Nested classes/interfaces inherited from interface org.refcodes.net.UrlAccessor
UrlAccessor.UrlBuilder, UrlAccessor.UrlMutator, UrlAccessor.UrlProperty
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_REDIRECT_DEPTH
-
Method Summary
All Methods Instance Methods Abstract 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()
.-
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.RedirectDepthAccessor
getRedirectDepth
-
Methods inherited from interface org.refcodes.net.RedirectDepthAccessor.RedirectDepthMutator
setRedirectDepth
-
Methods inherited from interface org.refcodes.net.UrlAccessor
getUrl
-
-
-
-
Field Detail
-
DEFAULT_REDIRECT_DEPTH
static final int DEFAULT_REDIRECT_DEPTH
- See Also:
- Constant Field Values
-
-
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.
-
-