Package blue. starry. penicillin. core. request
Types
Link copied to clipboard
Represents api request methods.
Link copied to clipboard
data class ApiRequestBuilder( val client: ApiClient, val httpMethod: HttpMethod, val host: EndpointHost, val path: String)
Content copied to clipboard
The builder class to construct api request.
Link copied to clipboard
data class EndpointHost( val domain: String, val domainForSigning: String? = null, val protocol: URLProtocol = URLProtocol.HTTPS, val port: Int = protocol.defaultPort)
Content copied to clipboard
Represents endpoint host.
Link copied to clipboard
Represents an enum class can be serialized with "value" property.
Functions
Link copied to clipboard
fun ApiRequestBuilder.formBody(vararg pairs: Pair<String, Any?>, mode: EmulationMode? = null)
Content copied to clipboard
Creates "application/x-www-form-urlencoded" content.
Link copied to clipboard
fun ApiRequestBuilder.header(headers: Headers, mode: EmulationMode? = null)
Content copied to clipboard
Adds existing Headers instance to headers.
fun ApiRequestBuilder.header( key: String, value: Any?, mode: EmulationMode? = null)
Content copied to clipboard
Sets a header key with value, or update existing one with value.
Link copied to clipboard
fun ApiRequestBuilder.headers(vararg pairs: Pair<String, Any?>, mode: EmulationMode? = null)
Content copied to clipboard
Sets header keys with value, or update existing one with value.
Link copied to clipboard
fun ApiRequestBuilder.jsonBody(vararg pairs: Pair<String, Any?>, mode: EmulationMode? = null)
Content copied to clipboard
fun ApiRequestBuilder.jsonBody(json: JsonObject, mode: EmulationMode? = null)
Content copied to clipboard
Creates "application/json" content.
Link copied to clipboard
The OutgoingContent.WriteChannelContent which provides "application/json".
Link copied to clipboard
fun ApiRequestBuilder.multiPartBody(mode: EmulationMode? = null, block: FormBuilder.() -> Unit)
Content copied to clipboard
Creates "multipart/form-data" content.
Link copied to clipboard
fun ApiRequestBuilder.parameter( key: String, value: Any?, mode: EmulationMode? = null)
Content copied to clipboard
Sets a parameter key with value, or update existing one with value.
Link copied to clipboard
fun ApiRequestBuilder.parameters(vararg pairs: Pair<String, Any?>, mode: EmulationMode? = null)
Content copied to clipboard
Sets parameter keys with value, or update existing one with value.