HTTP

@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.

@HTTP(method = "CUSTOM", path = "custom/endpoint/")
suspend fun customEndpoint(): Response

See also

Properties

Link copied to clipboard
val hasBody: Boolean = false

Override default rules, e.g., GET is not allowed to have a body

Link copied to clipboard

HTTP method verb.

Link copied to clipboard

Relative or absolute URL of the endpoint.