Package de.jensklingenberg.ktorfit.http

Types

Body
Link copied to clipboard
annotation class Body
DELETE
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class DELETE(value: String)
Field
Link copied to clipboard
annotation class Field(value: String, encoded: Boolean)
FieldMap
Link copied to clipboard
annotation class FieldMap(encoded: Boolean)
FormUrlEncoded
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class FormUrlEncoded

A function that is annotated with his, will have the header application/x-www-form-urlencoded added to the request

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

Make a GET request. if value is empty, you need to have a paramter with Url

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

Make a GET request.

Header
Link copied to clipboard
annotation class Header(value: String)
HeaderMap
Link copied to clipboard
annotation class HeaderMap
Headers
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class Headers(value: Array<String>)
HTTP
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class HTTP(method: String, path: String, hasBody: Boolean)

Make a GET request.

Multipart
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class Multipart
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)
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)
PUT
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class PUT(value: String)
Query
Link copied to clipboard
annotation class Query(value: String, encoded: Boolean)
QueryMap
Link copied to clipboard
annotation class QueryMap(encoded: Boolean)
QueryName
Link copied to clipboard
annotation class QueryName(encoded: Boolean)
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
Call<ResponseBody> list(@Url String url);