sealed class CacheControl
Represents a value for a |
|
class ContentDisposition : HeaderValueWithParameters
Represents |
|
sealed class ContentRange
Represents a |
|
class ContentType : HeaderValueWithParameters
Represents a value for a |
|
interface ContentTypeMatcher
Interface for any objects that can match a ContentType. |
|
data class Cookie
Represents a cookie with name, content and a set of settings such as expiration, visibility and security. A cookie with neither expires nor maxAge is a session cookie. |
|
enum class CookieEncoding
Cooke encoding strategy |
|
object |
|
object |
|
data class HeaderValue
Represents a header value. Similar to HeaderValueWithParameters |
|
data class HeaderValueParam
Represents a single value parameter |
|
abstract class HeaderValueWithParameters
Represents a header value that consist of content followed by parameters.
Useful for headers such as |
|
interface Headers : StringValues
Represents HTTP headers as a map from case-insensitive names to collection of String values |
|
class HeadersBuilder : StringValuesBuilder |
|
class HeadersImpl : Headers, StringValuesImpl |
|
class HeadersSingleImpl : Headers, StringValuesSingleImpl |
|
object HttpHeaders |
|
interface HttpMessage
A message either from the client or the server, that has headers associated. |
|
interface HttpMessageBuilder
A builder message either for the client or the server, that has a headers builder associated. |
|
data class HttpMethod
Represents an HTTP method (verb) |
|
data class HttpProtocolVersion
Represents an HTTP protocol version. |
|
data class HttpStatusCode
Represents an HTTP status code and description. |
|
class LinkHeader : HeaderValueWithParameters
Represents a |
|
interface Parameters : StringValues
Represents HTTP parameters as a map from case-insensitive names to collection of String values |
|
class ParametersBuilder : StringValuesBuilder |
|
class ParametersImpl : Parameters, StringValuesImpl |
|
class ParametersSingleImpl : Parameters, StringValuesSingleImpl |
|
enum class RangeUnits
Possible content range units: bytes and none |
|
data class RangesSpecifier
Range specifier for partial content requests (RFC 2616 sec 14.35.1) |
|
interface RequestConnectionPoint
Represents request address information is used to make a call. There are at least two possible instances: "local" is how we see request at the server application and "actual" is what we can recover from proxy provided headers. |
|
class URLBuilder
A URL builder with all mutable components |
|
data class URLProtocol
Represents URL protocol |
|
data class Url
Represents an immutable URL |
class BadContentTypeFormatException : Exception
Exception thrown when a content type string is malformed. |
|
class IllegalHeaderNameException : IllegalArgumentException
Thrown when an illegal header name was used.
A header name should only consist from visible characters
without delimiters "double quote" and the following characters: |
|
class IllegalHeaderValueException : IllegalArgumentException
Thrown when an illegal header value was used. A header value should only consist from visible characters, spaces and/or HTAB (0x09). |
|
class URLDecodeException : Exception
URL decoder exception |
|
class URLParserException : IllegalStateException
Thrown when failed to parse URL |
|
class UnsafeHeaderException : IllegalArgumentException
Thrown when an attempt to set unsafe header detected. A header is unsafe if listed in HttpHeaders.UnsafeHeadersList. |
const val DEFAULT_PORT: Int
Select default port value from protocol. |
|
val Url.authority: String
Url authority. val URLBuilder.authority: String
URLBuilder authority. |
|
val Url.fullPath: String
Full encoded path with query string but without domain, port and schema |
|
val Url.hostWithPort: String
Host:port pair, not normalized so port is always specified even if the port is schema's default |
fun URLBuilder(urlString: String): URLBuilder
Construct URLBuilder from urlString. fun URLBuilder(url: Url): URLBuilder
Construct URLBuilder from url. fun URLBuilder(builder: URLBuilder): URLBuilder
Construct URLBuilder from builder. |
|
fun Url(urlString: String): Url
fun Url(builder: URLBuilder): Url
Construct Url from builder without building origin. fun Url(uri: URI): Url
|
|
fun HttpMessage.cacheControl(): List<HeaderValue>
Parse |
|
fun HeaderValueWithParameters.charset(): <ERROR CLASS>?
Extracts a Charset value from the given fun HttpMessageBuilder. fun HttpMessageBuilder.charset(): <ERROR CLASS>? fun HttpMessage.charset(): <ERROR CLASS>?
Parse charset from |
|
fun URLBuilder.clone(): URLBuilder
Create a copy of this builder. Modifications in a copy is not reflected in the original instance and vise-versa. |
|
fun HttpMessageBuilder. fun HttpMessageBuilder.contentLength(): Long? fun HttpMessage.contentLength(): Long?
Parse |
|
fun contentRangeHeaderValue(range: LongRange?, fullLength: Long? = null, unit: RangeUnits = RangeUnits.Bytes): String fun contentRangeHeaderValue(range: LongRange?, fullLength: Long? = null, unit: String = RangeUnits.Bytes.unitToken): String
Format |
|
fun HttpMessageBuilder.contentType(type: ContentType): Unit
Set fun HttpMessageBuilder.contentType(): ContentType? fun HttpMessage.contentType(): ContentType?
Parse |
|
fun HttpMessageBuilder.cookies(): List<Cookie>
Parse |
|
fun HttpMessage.date(): Date?
Parse |
|
fun decodeCookieValue(encodedValue: String, encoding: CookieEncoding): String
Decode cookie value using the specified encoding |
|
fun encodeCookieValue(value: String, encoding: CookieEncoding): String
Encode cookie value using the specified encoding |
|
fun HeadersBuilder.etag(entityTag: String): Unit
Set fun HttpMessageBuilder.etag(): String? fun HttpMessage.etag(): String?
Parse |
|
fun HttpMessageBuilder.expires(): Date? fun HttpMessage.expires(): Date?
Parse |
|
fun ContentType.fileExtensions(): List<String>
Recommended file name extensions for this content type |
|
fun Parameters.formUrlEncode(): String
Encode form parameters |
|
fun Parameters.formUrlEncodeTo(out: Appendable): Unit
Encode form parameters to the specified out appendable |
|
fun headersOf(): Headers
Returns empty headers fun headersOf(name: String, value: String): Headers
Returns Headers instance containing only one header with the specified name and value fun headersOf(name: String, values: List<String>): Headers
Returns Headers instance containing only one header with the specified name and values fun headersOf(vararg pairs: Pair<String, List<String>>): Headers
|
|
fun hostIsIp(host: String): Boolean
Check if host is IPv4 or IPv6 address. |
|
fun HttpMessageBuilder.ifModifiedSince(date: Date): Unit
Set |
|
fun HttpMessageBuilder.ifNoneMatch(value: String): Unit
Set |
|
fun URLProtocol.isSecure(): Boolean
Check if the protocol is secure |
|
fun HttpStatusCode.isSuccess(): Boolean
Checks if a given status code is a success code according to HTTP standards. |
|
fun URLProtocol.isWebsocket(): Boolean
Check if the protocol is websocket |
|
fun HttpMessageBuilder.lastModified(): Date? fun HttpMessage.lastModified(): Date?
Parse |
|
fun HttpMessageBuilder.maxAge(seconds: Int): Unit
Append |
|
fun parametersOf(): Parameters
Returns an empty parameters instance fun parametersOf(name: String, value: String): Parameters
Creates a parameters instance containing only single pair fun parametersOf(name: String, values: List<String>): Parameters
Creates a parameters instance containing only single pair of name with multiple values fun parametersOf(vararg pairs: Pair<String, List<String>>): Parameters
Creates a parameters instance from the specified pairs |
|
fun parseAndSortContentTypeHeader(header: String?): List<HeaderValue>
Parse |
|
fun parseAndSortHeader(header: String?): List<HeaderValue>
Parse header value and sort multiple values according to qualities |
|
fun parseClientCookiesHeader(cookiesHeader: String, skipEscaped: Boolean = true): Map<String, String>
Parse client's |
|
fun parseHeaderValue(text: String?): List<HeaderValue> fun parseHeaderValue(text: String?, parametersOnly: Boolean): List<HeaderValue>
Parse header value respecting multi-values |
|
fun parseQueryString(query: String, startIndex: Int = 0, limit: Int = 1000): Parameters
Parse query string withing starting at the specified startIndex but up to limit pairs |
|
fun parseRangesSpecifier(rangeSpec: String): RangesSpecifier?
Parse |
|
fun parseServerSetCookieHeader(cookiesHeader: String): Cookie
Parse server's |
|
fun URLBuilder.pathComponents(components: List<String>): URLBuilder fun URLBuilder.pathComponents(vararg components: String): URLBuilder
Adds components to current encodedPath |
|
operator fun Parameters.plus(other: Parameters): Parameters
Plus operator function that creates a new parameters instance from the original one concatenating with other |
|
fun renderCookieHeader(cookie: Cookie): String
Format |
|
fun renderSetCookieHeader(cookie: Cookie): String fun renderSetCookieHeader(name: String, value: String, encoding: CookieEncoding = CookieEncoding.URI_ENCODING, maxAge: Int = 0, expires: GMTDate? = null, domain: String? = null, path: String? = null, secure: Boolean = false, httpOnly: Boolean = false, extensions: Map<String, String?> = emptyMap(), includeEncoding: Boolean = true): String
Format |
|
fun HttpMessage.setCookie(): List<Cookie>
Parse |
|
fun URLBuilder.takeFrom(urlString: String): URLBuilder
Take url parts from urlString throws URLParserException fun URLBuilder.takeFrom(url: URLBuilder): URLBuilder
Take components from another url builder fun URLBuilder.takeFrom(url: Url): URLBuilder
Take components from another url fun URLBuilder.takeFrom(uri: URI): URLBuilder
Take URI components from uri fun URLBuilder.takeFrom(url: URL): URLBuilder
Take URI components from url |
|
fun Url.toURI(): URI
|
|
fun HttpMessageBuilder.userAgent(content: String): Unit
Set |
|
fun HttpMessageBuilder.vary(): List<String>? fun HttpMessage.vary(): List<String>?
Parse |
|
fun ContentType.withCharset(charset: <ERROR CLASS>): ContentType
Creates a copy of |
val HttpStatusCode.Companion. |
fun ContentType.Companion.defaultForFile(file: File): ContentType fun ContentType.Companion.defaultForFile(file: Path): ContentType |
|
fun ContentType.Companion.defaultForFileExtension(extension: String): ContentType
Default ContentType for extension |
|
fun ContentType.Companion.defaultForFilePath(path: String): ContentType
Default ContentType for file path |
|
fun ContentType.Companion.fromFileExtension(ext: String): List<ContentType>
Recommended content type by file name extension |
|
fun ContentType.Companion.fromFilePath(path: String): List<ContentType>
Recommended content types by file path |
|
operator fun Url.Companion.invoke(fullUrl: String): Url
|