Path

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

This can be set if you have a segment in your URL that want to dynamically replace

Path parameters type may not be nullable.

@GET("post/{postId}")
suspend fun getPosts(@Path("postId") id: Int): List<Post>

foo.getPosts(25)
// Generate post/25

See also

Properties

Link copied to clipboard
val encoded: Boolean = false

Specifies whether the argument value to the annotated method parameter is already URL encoded.

Link copied to clipboard

Name of the placeholder to replace. Default the name of the function parameter