Path

annotation class Path(value: String, encoded: Boolean)

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

Parameters

value

When the URL of an HTTP Method Annotation contains curly braces. They will be replaced with the value of the corresponding parameter that has a matching value

encoded

true means that this value is already URL encoded and will not be encoded again

Path parameters type may not be nullable.


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

Constructors

Path
Link copied to clipboard
fun Path(value: String, encoded: Boolean = false)

Properties

encoded
Link copied to clipboard
val encoded: Boolean = false
value
Link copied to clipboard
val value: String