SimpleOKHttp

class SimpleOKHttp(url: String)

Simplified okHttp request

Parameters

url

Request url

Constructors

Link copied to clipboard
constructor(url: String)

Types

Link copied to clipboard
sealed class Result<T>

Result base calss

Functions

Link copied to clipboard

Set follow redirects

Link copied to clipboard
suspend fun get(): SimpleOKHttp.Result<Response>

Use GET method

Link copied to clipboard

Use GET method

Link copied to clipboard
fun header(key: String, value: String): SimpleOKHttp

Add a header

Link copied to clipboard

Add a group of headers

Link copied to clipboard
suspend fun post(body: RequestBody): SimpleOKHttp.Result<Response>

Use POST method

Link copied to clipboard
suspend fun postAsString(body: RequestBody): SimpleOKHttp.Result<String>

Use POST method

Link copied to clipboard

Set the request User Agent