HeaderFieldsAccessor<RequestHeaderFields>
, HttpBodyAccessor.HttpBodyProvider<RequestHeaderFields>
, HttpClientRequest
, HttpMethodAccessor
, HttpRequest
, RedirectDepthAccessor
, RedirectDepthAccessor.RedirectDepthMutator
, RedirectDepthAccessor.RedirectDepthProperty
, UrlAccessor
public class HttpClientRequestImpl extends HttpRequestImpl implements HttpClientRequest
HttpClientRequest
interface.HeaderFieldsAccessor.HeaderFieldsBuilder<T extends HeaderFields<?,?>,B extends HeaderFieldsAccessor.HeaderFieldsBuilder<T,B>>, HeaderFieldsAccessor.HeaderFieldsMutator<T extends HeaderFields<?,?>>, HeaderFieldsAccessor.HeaderFieldsProperty<T extends HeaderFields<?,?>>
HttpClientRequest.HttpClientRequestBuilder
HttpMethodAccessor.HttpMethodBuilder<B extends HttpMethodAccessor.HttpMethodBuilder<B>>, HttpMethodAccessor.HttpMethodMutator, HttpMethodAccessor.HttpMethodProperty
RedirectDepthAccessor.RedirectDepthBuilder<B extends RedirectDepthAccessor.RedirectDepthBuilder<B>>, RedirectDepthAccessor.RedirectDepthMutator, RedirectDepthAccessor.RedirectDepthProperty
UrlAccessor.UrlBuilder, UrlAccessor.UrlMutator, UrlAccessor.UrlProperty
Modifier and Type | Field | Description |
---|---|---|
protected MediaTypeFactoryLookup |
_mediaTypeFactoryLookup |
DEFAULT_REDIRECT_DEPTH
_headerFields, _httpMethod, _url
Constructor | Description |
---|---|
HttpClientRequestImpl(HttpMethod aHttpMethod,
Url aUrl,
int aRedirectDepth,
MediaTypeFactoryLookup aMediaTypeFactoryLookup) |
Instantiates a new http client request impl.
|
HttpClientRequestImpl(HttpMethod aHttpMethod,
Url aUrl,
Object aRequest,
int aRedirectDepth,
MediaTypeFactoryLookup aMediaTypeFactoryLookup) |
Instantiates a new http client request impl.
|
HttpClientRequestImpl(HttpMethod aHttpMethod,
Url aUrl,
Object aRequest,
MediaTypeFactoryLookup aMediaTypeFactoryLookup) |
Instantiates a new http client request impl.
|
HttpClientRequestImpl(HttpMethod aHttpMethod,
Url aUrl,
MediaTypeFactoryLookup aMediaTypeFactoryLookup) |
Instantiates a new http client request impl.
|
HttpClientRequestImpl(HttpMethod aHttpMethod,
Url aUrl,
RequestHeaderFields aHeaderFields,
Object aRequest,
int aRedirectDepth,
MediaTypeFactoryLookup aMediaTypeFactoryLookup) |
Instantiates a new http client request impl.
|
HttpClientRequestImpl(HttpMethod aHttpMethod,
Url aUrl,
RequestHeaderFields aHeaderFields,
Object aRequest,
MediaTypeFactoryLookup aMediaTypeFactoryLookup) |
Instantiates a new http client request impl.
|
Modifier and Type | Method | Description |
---|---|---|
int |
getRedirectDepth() |
Retrieves the redirect depth from the redirect depth property.
|
<REQ> REQ |
getRequest() |
Gets the request.
|
void |
setRedirectDepth(int aRedirectDepth) |
Sets the redirect depth for the redirect depth property.
|
<REQ> void |
setRequest(REQ aRequest) |
Sets the request for the request property.
|
String |
toHttpBody() |
Automatically sets the
ContentType to the
RequestHeaderFields retrieved from HeaderFieldsAccessor.getHeaderFields() . |
String |
toString() |
getHeaderFields
getHttpMethod
getHeaderFields, getHttpMethod, getUrl
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
letRedirectDepth
getUrl
protected MediaTypeFactoryLookup _mediaTypeFactoryLookup
public HttpClientRequestImpl(HttpMethod aHttpMethod, Url aUrl, MediaTypeFactoryLookup aMediaTypeFactoryLookup)
aHttpMethod
- the http methodaUrl
- The Url
from which to take the URL specific data.aMediaTypeFactoryLookup
- the media type factory lookuppublic HttpClientRequestImpl(HttpMethod aHttpMethod, Url aUrl, Object aRequest, MediaTypeFactoryLookup aMediaTypeFactoryLookup)
aHttpMethod
- the http methodaUrl
- The Url
from which to take the URL specific data.aRequest
- the requestaMediaTypeFactoryLookup
- the media type factory lookuppublic HttpClientRequestImpl(HttpMethod aHttpMethod, Url aUrl, RequestHeaderFields aHeaderFields, Object aRequest, MediaTypeFactoryLookup aMediaTypeFactoryLookup)
aHttpMethod
- the http methodaUrl
- The Url
from which to take the URL specific data.aHeaderFields
- the Header-FieldsaRequest
- the requestaMediaTypeFactoryLookup
- the media type factory lookuppublic HttpClientRequestImpl(HttpMethod aHttpMethod, Url aUrl, int aRedirectDepth, MediaTypeFactoryLookup aMediaTypeFactoryLookup)
aHttpMethod
- the http methodaUrl
- The Url
from which to take the URL specific data.aRedirectDepth
- The redirect depth provides the count of
HTTP-Request and HTTP-Response cycles where the response
represents a redirect as of
HttpStatusCode.isRedirectStatus()
. A value of -1
represents a nearly infinite HTTP-Request and HTTP-Response cycle
(infinite might mean a maximum of 256 cycle).aMediaTypeFactoryLookup
- the media type factory lookuppublic HttpClientRequestImpl(HttpMethod aHttpMethod, Url aUrl, Object aRequest, int aRedirectDepth, MediaTypeFactoryLookup aMediaTypeFactoryLookup)
aHttpMethod
- the http methodaUrl
- The Url
from which to take the URL specific data.aRequest
- the requestaRedirectDepth
- The redirect depth provides the count of
HTTP-Request and HTTP-Response cycles where the response
represents a redirect as of
HttpStatusCode.isRedirectStatus()
. A value of -1
represents a nearly infinite HTTP-Request and HTTP-Response cycle
(infinite might mean a maximum of 256 cycle).aMediaTypeFactoryLookup
- the media type factory lookuppublic HttpClientRequestImpl(HttpMethod aHttpMethod, Url aUrl, RequestHeaderFields aHeaderFields, Object aRequest, int aRedirectDepth, MediaTypeFactoryLookup aMediaTypeFactoryLookup)
aHttpMethod
- the http methodaUrl
- The Url
from which to take the URL specific data.aHeaderFields
- the Header-FieldsaRequest
- the requestaRedirectDepth
- The redirect depth provides the count of
HTTP-Request and HTTP-Response cycles where the response
represents a redirect as of
HttpStatusCode.isRedirectStatus()
. A value of -1 keeps a
redirect depth as used by default by underlying implementations.aMediaTypeFactoryLookup
- the media type factory lookuppublic <REQ> REQ getRequest()
getRequest
in interface HttpClientRequest
REQ
- the generic typepublic <REQ> void setRequest(REQ aRequest)
setRequest(Object)
supports the
HttpBodyMap
to marshal an HttpBodyMap
into an HTTP
Request-Body.setRequest
in interface HttpClientRequest
REQ
- the generic typeaRequest
- The request to be stored by the request property.public String toHttpBody() throws BadRequestException
ContentType
to the
RequestHeaderFields
retrieved from HeaderFieldsAccessor.getHeaderFields()
.
(see
HeaderFields.putContentType(org.refcodes.web.HttpMediaType)
) Converts an object representing the HTTP body to a String
instance. Automatically determines the ContentType
from any
headers when applicable.toHttpBody
in interface HttpBodyAccessor.HttpBodyProvider<RequestHeaderFields>
toHttpBody
in interface HttpClientRequest
String
instance represented by the
according object.BadRequestException
public int getRedirectDepth()
getRedirectDepth
in interface RedirectDepthAccessor
public void setRedirectDepth(int aRedirectDepth)
setRedirectDepth
in interface RedirectDepthAccessor.RedirectDepthMutator
aRedirectDepth
- The redirect depth to be stored by the redirect
depth property.Copyright © 2021. All rights reserved.