Query

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

Used for query parameters

@ GET("comments") suspend fun getCommentsById(@Query("postId") postId: String): List

A request with getCommentsById(3) will result in the relative URL “comments?postId=3”

@ GET("comments") suspend fun getCommentsById(@Query("postId") postId: List): List

A request with getCommentsById(listOf("3",null,"4")) will result in the relative URL “comments?postId=3&postId=4”

===== value is the key of the query parameter

Parameters

encoded

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

Constructors

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

Properties

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