Package org.refcodes.web
HttpStatusCode or exceptions representing erroneous
HTTP state, or if you are tired of cookie handling, Header-Field processing
... and so on:
This artifact provides various types such as Cookie,
FormFields, HeaderFields or
HttpMethod, which enable you to use such HTTP based
structures in a native Java way while having a tool at hand to bridge back
into the HTTP protocol world. HTTP related error codes are provided as
exception types such as NotFoundException (404) or
`InternalServerErrorException` (500).
Please note that the HttpBodyMap is most useful when
you have to handle dynamic data structures. The
HttpBodyMap type is a "dynamic" type in terms of
it's structure being represented by paths'. When a data structure is parsed
e.g. from JSON or XML, then the data structure's internal structure and
values are reflected by according paths's and values in the
HttpBodyMap. The
HttpBodyMap is a kind of flat (no nested maps)
representation of the according (nested) data structures. Implementations of
the HttpClientRequest,
HttpClientResponse,
HttpServerRequest as well as
HttpServerResponse types support the
HttpBodyMap.
As another example, the BasicAuthCredentials make it
ease to parse or create Basic-Auth Header-Fields.
Other interesting types and classes to mention are the
Port enumeration, defining quite a few default
ports or the MediaTypeFactory interface, which's
implementations make marshaling and unmarshaling of your types from and to
JSON, XML (and so on) an easy task.
Predefined MIME-Types are bundled in the MediaType
enumeration, as of the information provided by the
[`IANA`](http://www.iana.org/assignments/media-types/media-types.xhtml),
effective in October 2016.
See the [Javadoc](https://www.javadoc.io/doc/org.refcodes/refcodes-web) for a full overview on this artifact.
-
ClassDescriptionAbstract implementation of the
HeaderFieldstype.AbstractHttpFields<T extends HttpFields<T>>Abstract implementation of theHeaderFieldstype.Implementation of theHttpRequestinterface.Implementation of theHttpResponseinterface.The Enum AuthType.Provides an accessor for aAuthTypeproperty.Provides a builder method for aAuthTypeproperty returning the builder for applying multiple build operations.Provides a mutator for aAuthTypeproperty.Provides aAuthTypeproperty.The Interface AuthTypeCredentials.The Class BadGatewayException.The Class BadGatewayRuntimeException.Proprietary code and only used inside a REFCODES.ORG client not trespassing any networking border (the error is generated by the client for the client locally).Proprietary code and only used inside a REFCODES.ORG client not trespassing any networking border (the error is generated by the client for the client locally).The Class BadRequestException.The Class BadRequestRuntimeException.Proprietary code and only used inside a REFCODES.ORG client not trespassing any networking border (the error is generated by the client for the client locally).Proprietary code and only used inside a REFCODES.ORG client not trespassing any networking border (the error is generated by the client for the client locally).Provides an accessor for a base locator property.Provides a builder method for a base locator property returning the builder for applying multiple build operations.Provides a mutator for a base locator property.Provides a base locator property.Provides an accessor for a base URL (protocol, host, port, locator) property.BaseUrlAccessor.BaseUrlBuilder<B extends BaseUrlAccessor.BaseUrlBuilder<B>>Provides a builder method for a base URL (protocol, host, port, path) property returning the builder for applying multiple build operations.Provides a mutator for a base URL (protocol, host, port, locator) property.Provides a base URL (protocol, host, port, path) property.TheBasicAuthCredentialsdefines a type for representing a Basic-Authentication credentials Header-Field.Provides an accessor for aBasicAuthCredentialsproperty.BasicAuthCredentialsAccessor.BasicAuthCredentialsBuilder<B extends BasicAuthCredentialsAccessor.BasicAuthCredentialsBuilder<B>>Provides a builder method for aBasicAuthCredentialsproperty returning the builder for applying multiple build operations.Provides a mutator for aBasicAuthCredentialsproperty.Provides aBasicAuthCredentialsproperty.TheBasicAuthCredentialsBuildercompares the secret (BasicAuthCredentials.getSecret()) case sensitive but the username (BasicAuthCredentials.getIdentity()) case insensitive within theBasicAuthCredentials.equals(Object)method.Thrown in case HTTP basic authorization failed, e.g. verifyingBasicAuthCredentialsfailed.Thrown in case HTTP basic authorization failed, e.g. verifyingBasicAuthCredentialsfailed.BasicAuthObservable<B extends BasicAuthObservable<B>>An observable which notifies the registeredBasicAuthObserveron incoming HTTP Basic-Authentication requests.An observer being notified by incoming HTTP Basic-Authentication requests which might have been registered viaBasicAuthObservable.onBasicAuthRequest(BasicAuthObserver)possibly using lambda syntax.Defines aBasicAuthRequestdescribes a Baisc-Auth request as of HTTP.Thrown in case HTTP basic authorization is required but no requiredHeaderField.WWW_AUTHENTICATEdata was found, e.g.Thrown in case HTTP basic authorization is required but no requiredHeaderField.WWW_AUTHENTICATEdata was found, e.g.The enumeration for a Basic-Auth response.TheBasicCredentialsdescribes the attributes required by a Basic-Auth authentication over HTTP(S).TheBearerAuthCredentialsdefines a type for representing a Bearer-Authentication credentials Header-Field.Provides an accessor for aBearerAuthCredentialsproperty.BearerAuthCredentialsAccessor.BearerAuthCredentialsBuilder<B extends BearerAuthCredentialsAccessor.BearerAuthCredentialsBuilder<B>>Provides a builder method for aBearerAuthCredentialsproperty returning the builder for applying multiple build operations.Provides a mutator for aBearerAuthCredentialsproperty.Provides aBearerAuthCredentialsproperty.The Class ConflictException.The Class ConflictRuntimeException.ContentEncodings are specified an an HTTP Header-FieldsHeaderField.ACCEPT_ENCODINGorHeaderField.CONTENT_ENCODINGand how to encode a HTTP body or how a HTTP body is encoded.AContentTyperepresents aMediaTypeand its accordingTopLevelTypewith additional (optional) suffixed parameters (as of the according HTTP Header-Fields).Provides an accessor for a Content-Type property.Provides a builder method for a Content-Type property returning the builder for applying multiple build operations.Provides a mutator for a Content-Type property.Provides a Content-Type property.A provider interface provides a "toSomething(?)"TheCookierepresents a HTTP cookie.The Enum CookieAttribute.The Class ExpectationFailedException.The Class ExpectationFailedRuntimeException.The Class FailedDependencyException.The Class FailedDependencyRuntimeException.The Class ForbiddenException.The Class ForbiddenRuntimeException.TheFormFieldsrepresent the URL's Query-String by the notation originally used by the GET request of the ancient web forms (see "https://en.wikipedia.org/wiki/Query_string#Web_forms").Provides an accessor for a request Form-Fields property.Provides a mutator for a request Form-Fields property.Provides a mutator for a request Form-Fields property.Provides a request Form-Fields property.Implements theMediaTypeFactoryfor Media-Type "application/x-www-form-urlencoded" (MediaType.APPLICATION_X_WWW_FORM_URLENCODED).Provides an accessor for a fragment property.Provides a mutator for an fragment property.Provides a mutator for a fragment property.Provides a fragment property.The Class GatewayTimeoutException.The Class GatewayTimeoutRuntimeException.The Class GoneException.The Class GoneRuntimeException.TheGrantTypeenumerations.The Enum HeaderField.Provides an accessor for aHeaderFieldproperty.Provides a builder method for aHeaderFieldproperty returning the builder for applying multiple build operations.Provides a mutator for aHeaderFieldproperty.Provides aHeaderFieldproperty.TheHeaderFieldsreflect the structure of a HTTP header and may be used to represent a HTTP header.Provides an accessor for an Header-Fields property.HeaderFieldsAccessor.HeaderFieldsBuilder<T extends HeaderFields<?,?>, B extends HeaderFieldsAccessor.HeaderFieldsBuilder<T, B>> Provides a mutator for an Header-Fields property.Provides a mutator for an Header-Fields property.Provides an Header-Fields property.Provides an accessor for a host property.HostAccessor.HostBuilder<B extends HostAccessor.HostBuilder<?>>Provides a mutator for an host property.Provides a mutator for a host property.Provides a host property.Implements theMediaTypeFactoryfor Media-Type "application/YAML" (MediaType.APPLICATION_YAML).Provides an accessor for a HTTP body property.Provides a builder body for a HTTP body property returning the builder for applying multiple build operations.Provides a mutator for a HTTP body property.Provides a HTTP body property.HttpBodyAccessor.HttpBodyProvider<EXC extends Exception>A provider interface provides a "toSomething(?)"TheHttpBodyMaptype is a "dynamic" type in terms of it's structure being represented by paths'.This context describes all information required to open a client (HTTP or HTTPS).TheHttpClientContextBuilderimplements theHttpClientContextBuilderinterface.TheHttpClientInterceptableprovides base functionality for working withHttpClientInterceptorinstances using thePreHttpClientInterceptableas well as thePostHttpClientInterceptabledefinitions.AnHttpClientInterceptordefinition for pre- as well as post-processingHttpClientRequestas well asHttpClientResponseinstances.Defines aHttpClientRequestbeing the request as produced by the client.Defines aHttpClientResponsebeing the response as consumed by the client.Base exception HTTP related problems.HttpFields<B extends HttpFields<B>>Various key/value "collections" we run across when we develop HTTP based applications may have more then one value for one key.Provides an accessor for a HTTPInputStreambody property.HttpInputStreamAccessor.HttpInputStreamBuilder<B extends HttpInputStreamAccessor.HttpInputStreamBuilder<B>>Provides a builder body for a HTTPInputStreamproperty returning the builder for applying multiple build operations.Provides a mutator for aInputStreamproperty.Provides a HTTPInputStreamproperty.HttpInputStreamAccessor.HttpInputStreamProvider<EXC extends Exception>A provider interface provides a "toSomething(?)"TheHttpInterceptableprovides base functionality for working withHttpInterceptorinstances using thePreHttpInterceptableas well as thePostHttpInterceptabledefinitions.AnHttpInterceptordefinition for pre- as well as post-processingHttpRequestas well asHttpResponseinstances.TheHttpMediaTypeconverts an implementing instance's state into an HTTP media type as used in HTTP Header-Fields.Provides an accessor for a HTTP Media-Type property.Provides a builder body for a HTTP Media-Type property returning the builder for applying multiple build operations.Provides a mutator for a HTTP Media-Type property.Provides a HTTP Media-Type property.HttpMediaTypeAccessor.HttpMediaTypeProvider<EXC extends Exception>A provider interface provides a "toSomething(?)"The Enum HttpMethod.Provides an accessor for a HTTP-Method property.Provides a builder method for a HTTP-Method property returning the builder for applying multiple build operations.Provides a mutator for a HTTP-Method property.Provides a HTTP-Method property.Defines a HTTP-Request, being theHttpMethod, the Header-Fields and the locator representing, though without the request body.HttpRequestBuilder<B extends HttpRequestBuilder<B>>The Interface HttpRequestBuilder.Defines aHttpResponsebeing the response Header-Fields and the response body.The Interface HttpResponseBuilder.Thrown by a HTTP-Response handling system in case of some unexpected response.Thrown by a HTTP-Response handling system in case of some unexpected response.The Class HttpRuntimeException.An observable which notifies the registeredHttpsConnectionRequestObserveron incoming HTTPS requests.An observer being notified by incoming HTTPS requests which might have been registered viaHttpsConnectionRequestObservable.onConnectionRequest(HttpsConnectionRequestObserver)possibly using lambda syntax.This context describes all information required to open a server (HTTP or HTTPS) and bind a port.TheHttpServerContextBuilderimplements theHttpServerContextinterface extending it with builder functionality..TheHttpServerInterceptableprovides base functionality for working withHttpServerInterceptorinstances using thePreHttpServerInterceptableas well as thePostHttpServerInterceptabledefinitions.AnHttpServerInterceptordefinition for pre- as well as post-processingHttpServerRequestas well asHttpServerResponseinstances.Defines aHttpServerRequestbeing the request as consumed by the server.Defines aHttpServerResponseas produced by the server.The org.apache.commons.httpclient.HttpStatus constants as enumeration.Provides access to a HTTP Status-Code property including all known HTTP HTTP Status-Codes (success as well as error codes) as ofHttpStatusCode.HttpStatusCodeAccessor.HttpStatusCodeBuilder<B extends HttpStatusCodeAccessor.HttpStatusCodeBuilder<B>>Provides a builder method for a HTTP Status-Code property returning the builder for applying multiple build operations.Extends theHttpStatusCodeAccessorwith a setter method.Extends theHttpStatusCodeAccessorwith a setter method.Base HTTP exception, thrown in case of HTTP status code related exceptions (e.g. as of a HTTP response was of an erroneous status).The Class HttpStatusRuntimeException.Only the Success 2xx codes as of (from) theHttpStatusCodeenumeration.Provides access to a HTTP success code property including just the 2xx HTTP success codes as ofHttpSuccessCodeexcluding all HTTP error codes.HttpSuccessCodeAccessor.HttpSuccessCodeBuilder<B extends HttpSuccessCodeAccessor.HttpSuccessCodeBuilder<B>>Provides a builder method for a HTTP success code property returning the builder for applying multiple build operations.Extends theHttpSuccessCodeAccessorwith a setter method.Extends theHttpSuccessCodeAccessorwith a setter method.The Class HttpVersionNotSupportedException.The Class HttpVersionNotSupportedRuntimeException.The Class InsufficientSpaceOnResourceException.The Class InsufficientSpaceOnResourceRuntimeException.The Class InsufficientStorageException.The Class InsufficientStorageRuntimeException.Proprietary code and only used inside a REFCODES.ORG client not trespassing any networking border (the error is generated by the client for the client locally).Proprietary code and only used inside a REFCODES.ORG client not trespassing any networking border (the error is generated by the client for the client locally).The Class InternalServerErrorException.The Class InternalServerErrorRuntimeException.Implements theMediaTypeFactoryfor Media-Type "application/json" (MediaType.APPLICATION_JSON).The Class LengthRequiredException.The Class LengthRequiredRuntimeException.Some simple load balancing strategies.Provides access to a load balancing strategy property as ofLoadBalancingStrategy.LoadBalancingStrategyAccessor.LoadBalancingStrategyBuilder<B extends LoadBalancingStrategyAccessor.LoadBalancingStrategyBuilder<B>>Provides a builder method for a load balancing strategy property returning the builder for applying multiple build operations.Extends theLoadBalancingStrategyAccessorwith a setter method.Extends theLoadBalancingStrategyAccessorwith a setter method.Provides an accessor for a local address property.Provides a builder method for a local address property returning the builder for applying multiple build operations.Provides a mutator for a local address property.Provides a local address property.The Class LockedException.The Class LockedRuntimeException.TheMediaTypeis the Media-Sub-Type part of a HTTP Media-Type.Provides an accessor for a Media-Type property.Provides a builder method for a Media-Type property returning the builder for applying multiple build operations.Provides a mutator for a Media-Type property.Provides a Media-Type property.TheMediaTypeFactorycreates instances from an HTTP body and creates an HTTP body from given instances according to theMediaType(as ofMediaTypesAccessor.getMediaTypes()) for which theMediaTypeFactoryis responsible.The Interface MediaTypeFactoryLookup.Adds functionality to modify theMediaTypeFactoryLookupe.g.Known or in this scope usedMediaTypeparameters.Provides an accessor for a Media-Types property.Provides a builder method for a Media-Types property returning the builder for applying multiple build operations.Provides a mutator for a Media-Types property.Provides a Media-Types property.The Class MethodFailureException.The Class MethodFailureRuntimeException.The Class MethodNotAllowedException.The Class MethodNotAllowedRuntimeException.The Class MovedPermanentlyException.The Class MovedPermanentlyRuntimeException.The Class MovedTemporarilyException.The Class MovedTemporarilyRuntimeException.The Class MultipleChoicesException.The Class MultipleChoicesRuntimeException.The Class MultiStatusException.The Class MultiStatusRuntimeException.The Class NoContentException.The Class NoContentRuntimeException.The Class NonAuthoritativeInformationException.The Class NonAuthoritativeInformationRuntimeException.The Class NotAcceptableException.The Class NotAcceptableRuntimeException.The Class NotFoundException.The Class NotFoundRuntimeException.The Class NotImplementedException.The Class NotImplementedRuntimeException.The Class NotModifiedException.The Class NotModifiedRuntimeException.The Enum OauthField.An OAuth-Token contains all relevant information to access a protected resource and refresh the the access token.Provides an accessor for a OAuth token property.Provides a builder method for a OAuth token property returning the builder for applying multiple build operations.Provides a mutator for a OAuth token property.Provides a OAuth token property.The Class PartialContentException.The Class PartialContentRuntimeException.The Class PaymentRequiredException.The Class PaymentRequiredRuntimeException.ThePostHttpClientInterceptabledefines aPostHttpInterceptablefor thePostHttpClientInterceptortype.AnPostHttpClientInterceptordefinition for post-processingHttpClientRequestas well asHttpClientResponseinstances.ThePostHttpInterceptableprovides base functionality for working withPostHttpInterceptorinstances.AnPostHttpInterceptordefinition for post-processingHttpRequestas well asHttpResponseinstances.ThePostHttpServerInterceptabledefines aPostHttpInterceptablefor thePostHttpServerInterceptortype.AnPostHttpServerInterceptordefinition for post-processingHttpServerRequestas well asHttpServerResponseinstances.The Class PreconditionFailedException.The Class PreconditionFailedRuntimeException.ThePreHttpClientInterceptabledefines aPreHttpInterceptablefor thePreHttpClientInterceptortype.AnPreHttpClientInterceptordefinition for pre-processingHttpClientRequestas well asHttpClientResponseinstances.ThePreHttpInterceptableprovides base functionality for working withPreHttpInterceptorinstances.ThePreHttpServerInterceptabledefines aPreHttpInterceptablefor thePreHttpServerInterceptortype.AnPreHttpServerInterceptordefinition for pre-processingHttpServerRequestas well asHttpServerResponseinstances.The Enum Proxy.The Class ProxyAuthenticationRequiredException.The Class ProxyAuthenticationRequiredRuntimeException.Provides an accessor for a request Query-Fields property.Provides a mutator for a request Query-Fields property.Provides a mutator for a request Query-Fields property.Provides a request Query-Fields property.Provides an accessor for a realm property.RealmAccessor.RealmBuilder<B extends RealmAccessor.RealmBuilder<B>>Provides a builder method for a realm property returning the builder for applying multiple build operations.Provides a mutator for a realm property.Provides a realm property.The Class ReauthenticationRequiredException.The Class ReauthenticationRequiredRuntimeException.Provides an accessor for a redirect depth property.Provides a builder method for a redirect depth property returning the builder for applying multiple build operations.Provides a mutator for a redirect depth property.Provides a redirect depth property.Provides an accessor for a remote address property.Provides a builder method for a remote address property returning the builder for applying multiple build operations.Provides a mutator for a remote address property.Provides a remote address property.TheRequestCookierepresents a request cookies: We use URL encoding / decoding for the cookie value (regardingRequestCookie.fromHttpCookie(String)andRequestCookie.toHttpCookie()) to make life easier and not fall into the trap of unescaped values.The Class RequestedRangeNotSatisfiableException.The Class RequestedRangeNotSatisfiableRuntimeException.TheRequestHeaderFieldsreflect the structure of a HTTP-Header and may be used to represent a HTTP-Header.Provides an accessor for an request Header-Fields property.RequestHeaderFieldsAccessor.RequestHeaderFieldsBuilder<B extends RequestHeaderFieldsAccessor.RequestHeaderFieldsBuilder<?>>Provides a mutator for an request Header-Fields property.Provides a mutator for an request Header-Fields property.Provides an request Header-Fields property.The Class RequestTimeoutException.The Class RequestTimeoutRuntimeException.The Class RequestTooLongException.The Class RequestTooLongRuntimeException.The Class RequestUriTooLongException.The Class RequestUriTooLongRuntimeException.The Class ResetContentException.The Class ResetContentRuntimeException.As of "HTTP cookies explained - NCZOnline": "...TheResponseHeaderFieldsreflect the structure of a HTTP header and may be used to represent a HTTP header.Provides an accessor for an response Header-Fields property.ResponseHeaderFieldsAccessor.ResponseHeaderFieldsBuilder<B extends ResponseHeaderFieldsAccessor.ResponseHeaderFieldsBuilder<?>>Provides a mutator for an response Header-Fields property.Provides a mutator for an response Header-Fields property.Provides an response Header-Fields property.Provides an accessor for a URL scheme.SchemeAccessor.SchemeBuilder<B extends SchemeAccessor.SchemeBuilder<B>>Provides a builder method for a URL scheme returning the builder for applying multiple build operations.Provides a mutator for a URL scheme.Provides a URL scheme.The Class SeeOtherException.The Class SeeOtherRuntimeException.The Class ServiceUnavailableException.The Class ServiceUnavailableRuntimeException.The Class TemporaryRedirectException.The Class TemporaryRedirectRuntimeException.Implements theMediaTypeFactoryfor Media-Type "text/plain" (MediaType.TEXT_PLAIN).The Interface TokenCredentials.The Enum TokenType.TheTopLevelTypeis the top-level part of a HTTP Media-Type.Provides an accessor for a Media-Top-Level-Type property.Provides a builder method for a Media-Top-Level-Type property returning the builder for applying multiple build operations.Provides a mutator for a Media-Top-Level-Type property.Provides a Media-Top-Level-Type property.Transport Layer Security Protocols (TLS-Protocols) known by the herein contained libraries.The Class UnassignedStatusCodeException.The Class UnassignedStatusCodeRuntimeException.The Class UnauthorizedException.The Class UnauthorizedRuntimeException.The Class UnavailableForLegalReasonsException.The Class UnavailableForLegalReasonsRuntimeException.The Class UnprocessableEntityException.The Class UnprocessableEntityRuntimeException.Thrown in case a Media-Type has been provied which is not supported.The Class UnsupportedMediaTypeRuntimeException.TheUrlclass represents an immutable URL: An URL looks something like this: "scheme://[identity[:secret]@]host[:port][/path][?Provides an accessor for aUrlproperty..Provides a builder method for aUrlproperty returning the builder for applying multiple build operations.Provides a mutator for aUrlproperty.Provides aUrlproperty.TheUrlBuilderextends an immutableUrlwith mutable functionality.Declarative syntactic sugar which may be statically imported in order to allow declarative definitions forUrl(UrlBuilder) creation and tweaking:import static org.refcodes.web.UrlSugarThe Class UseProxyException.The Class UseProxyRuntimeException.Provides an accessor for a user agent property.Provides a builder method for a user agent property returning the builder for applying multiple build operations.Provides a mutator for a user agent property.Provides a user agent property.The Class VersionNotSupportedException.The Class VersionNotSupportedRuntimeException.Provides an accessor for a virtual host property.Provides a mutator for an virtual host property.Provides a mutator for a virtual host property.Provides a virtual host property.The base exception for networking related issues.The base runtime exception for networking related issues.Implements theMediaTypeFactoryfor Media-Type "application/xml" (MediaType.APPLICATION_XML).Implements theMediaTypeFactoryfor Media-Type "application/YAML" (MediaType.APPLICATION_YAML).