Package de.jensklingenberg.ktorfit.http

Types

Body
Link copied to clipboard
annotation class Body

Use this to upload data in an HTTP Body @POST("createIssue") fun upload(@Body issue: Issue)

DELETE
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class DELETE(value: String)

Make a DELETE request.

Field
Link copied to clipboard
annotation class Field(value: String, encoded: Boolean)

Needs to be used in combination with FormUrlEncoded

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

Needs to be used in combination with FormUrlEncoded

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

A function that is annotated with this, will have the header application/x-www-form-urlencoded added to the request. Needed to use @Field @FieldMap

GET
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class GET(value: String)

Make a GET request.

HEAD
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class HEAD(value: String)

Make a HEAD request.

Header
Link copied to clipboard
annotation class Header(value: String)

Add a header to a request

HeaderMap
Link copied to clipboard
annotation class HeaderMap

Add headers to a request

Headers
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class Headers(value: String)

Add headers to a request

HTTP
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class HTTP(method: String, path: String, hasBody: Boolean)

Make a request with a custom HTTP method.

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

Send multipart data

OPTIONS
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class OPTIONS(value: String)

Make an OPTIONS request.

Part
Link copied to clipboard
annotation class Part(value: String)

sTRING OR List< PartData>

PartMap
Link copied to clipboard
annotation class PartMap(encoding: String)

If the type is List the value will be used directly with its content type.

PATCH
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class PATCH(value: String)

Make a PATCH request.

Path
Link copied to clipboard
annotation class Path(value: String, encoded: Boolean)

This can be set if you have parts in your URL that want to dynamically replaced

POST
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class POST(value: String)

Make a POST request.

PUT
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class PUT(value: String)

Make a PUT request.

Query
Link copied to clipboard
annotation class Query(value: String, encoded: Boolean)

Used for query parameters

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

Used for query parameters

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

Used for query parameters

ReqBuilder
Link copied to clipboard
annotation class ReqBuilder

This can be used to add additional configurations to a request the parameter type has to be HttpRequestBuilder.() -> Unit

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

@GET()