Package-level declarations

Types

Link copied to clipboard
annotation class Body

For upload data in an HTTP Body on a POST/PUT request

Link copied to clipboard
annotation class Cookie(val name: String, val value: String = KTORGEN_DEFAULT_NAME, val maxAge: Int = 0, val expiresTimestamp: Long = -1, val domain: String = "", val path: String = "", val secure: Boolean = false, val httpOnly: Boolean = false, val extensions: Array<Cookie.PairString> = [])

Add a cookie to the request

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class DELETE(@Language(value = "http-url-reference") val value: String = "")

Make a DELETE request.

Link copied to clipboard
annotation class Field(val value: String = KTORGEN_DEFAULT_NAME, val encoded: Boolean = false)

A named pair for a form-encoded request.

Link copied to clipboard
annotation class FieldMap(val encoded: Boolean = false)

Named key/value pairs for a form-encoded request.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class FormUrlEncoded

Indicate the body will use form URL encoding.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class Fragment(val value: String, val encoded: Boolean = false)

Add a hash mark # introduces the optional fragment near the end of the URL.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class GET(@Language(value = "http-url-reference") val value: String = "")

Make a GET request.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class HEAD(@Language(value = "http-url-reference") val value: String = "")

Make a HEAD request

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class Header(@Language(value = "http-header-reference") val name: String, val value: String)

Add a header to a request

Link copied to clipboard
annotation class HeaderMap

Add headers to a request

Link copied to clipboard
annotation class HeaderParam(@Language(value = "http-header-reference") val name: String)

Adds a single HTTP header whose value is provided at call time.

Link copied to clipboard
annotation class Headers(val values: String)

This is only for easy migration from other libraries, using this doesn't generate code

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class HTTP(@Language(value = "http-method-reference") val method: String, @Language(value = "http-url-reference") val path: String = "", val hasBody: Boolean = false)

Make a request with a custom HTTP verb.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class Multipart

Indicate the request body is multipart

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class OPTIONS(@Language(value = "http-url-reference") val value: String = "")

Make an OPTIONS request

Link copied to clipboard
annotation class Part(val value: String = "", val encoding: String = "binary")

Annotate a single part of a multipart request.

Link copied to clipboard
annotation class PartMap(val encoding: String = "binary")

Denote name and value parts of a multipart request.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class PATCH(@Language(value = "http-url-reference") val value: String = "")

Make a PATCH request.

Link copied to clipboard
annotation class Path(@Language(value = "http-url-reference") val value: String = KTORGEN_DEFAULT_NAME, val encoded: Boolean = false)

Named replacement in a URL path segment

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class POST(@Language(value = "http-url-reference") val value: String = "")

Make a POST request

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class PUT(@Language(value = "http-url-reference") val value: String = "")

Make a PUT request

Link copied to clipboard
annotation class Query(@Language(value = "http-url-reference") val value: String = KTORGEN_DEFAULT_NAME, val encoded: Boolean = false)

Query parameter appended to the URL

Link copied to clipboard
annotation class QueryMap(val encoded: Boolean = false)

Query parameter keys and values appended to the URL.

Link copied to clipboard
annotation class QueryName(val encoded: Boolean = false)

Query parameter appended to the URL that has no value.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class Streaming

Deprecated, not needed

Link copied to clipboard
annotation class Tag(val value: String = KTORGEN_DEFAULT_NAME)

Adds the argument instance as a request tag using the type as AttributeKey.

Link copied to clipboard
annotation class Url

Set the URL of the request