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 aHttpClientRequestbeing the request as produced by the client.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceHttpClientRequest.HttpClientRequestBuilderBuilder for theHttpClientRequestinterface.-
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 intDEFAULT_REDIRECT_DEPTH
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <REQ> REQgetRequest()Retrieves the request from the request property.<REQ> voidsetRequest(REQ aRequest)Sets the request for the request property.java.lang.StringtoHttpBody()Automatically sets theContentTypeto theRequestHeaderFieldsretrieved 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 BadRequestExceptionAutomatically sets theContentTypeto theRequestHeaderFieldsretrieved fromHeaderFieldsAccessor.getHeaderFields(). (seeHeaderFields.putContentType(org.refcodes.net.HttpMediaType)) Converts an object representing the HTTP body to aStringinstance. Automatically determines theContentTypefrom any headers when applicable.- Specified by:
toHttpBodyin interfaceHttpBodyAccessor.HttpBodyProvider<BadRequestException>- Returns:
- The converted
Stringinstance 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 theHttpBodyMapto marshal anHttpBodyMapinto an HTTP Request-Body.- Type Parameters:
REQ- the generic type- Parameters:
aRequest- The request to be stored by the request property.
-
-