setMethod

abstract fun setMethod(method: (HttpMethods) -> HttpMethod)

设置请求的 HTTP 方法(GET, POST, PUT 等)。

Parameters

method

一个 lambda,它接收一个 HttpMethods 实例,并返回所需的 HttpMethod。 例如:setMethod { it.getPut() }