Package-level declarations

Types

Link copied to clipboard

Enum class representing standard HTTP request methods.

Link copied to clipboard
class UserAgentManager(client: OkHttpClient)

Manages user agents for HTTP requests.

Link copied to clipboard

An OkHttpClient interceptor that uses WebView.

Properties

Link copied to clipboard
const val USER_AGENT: String

The default User-Agent header value.

Functions

Link copied to clipboard
fun OkHttpClient.formRequest(url: String, method: HttpMethod, body: Map<String, String>, headers: Headers = Headers.headersOf(), userAgent: String? = null): Call

Creates a form request using HTTP POST method.

Link copied to clipboard
fun OkHttpClient.genericBodyRequest(url: String, method: HttpMethod, body: String, mediaType: MediaType?, headers: Headers = Headers.headersOf(), userAgent: String? = null): Call

Creates a request with a generic body using the specified HTTP method.

Link copied to clipboard
fun OkHttpClient.Builder.ignoreAllSSLErrors(): OkHttpClient.Builder

Configures the OkHttpClient.Builder to ignore all SSL errors, allowing connections to be established even if certificates are not trusted.

Link copied to clipboard
fun OkHttpClient.jsonRequest(url: String, method: HttpMethod, json: Any, headers: Headers = Headers.headersOf(), userAgent: String? = null): Call

Creates a JSON request using the specified HTTP method.

Link copied to clipboard
fun OkHttpClient.request(url: URL, method: HttpMethod = HttpMethod.GET, body: RequestBody? = null, headers: Headers = Headers.headersOf(), userAgent: String? = null): Call

Creates an OkHttp Call for a request with the specified URL.

fun OkHttpClient.request(url: String, method: HttpMethod = HttpMethod.GET, body: RequestBody? = null, headers: Headers = Headers.headersOf(), userAgent: String? = null): Call

Creates a generic HTTP request.

fun OkHttpClient.request(url: HttpUrl, method: HttpMethod = HttpMethod.GET, body: RequestBody? = null, headers: Headers = Headers.headersOf(), userAgent: String? = null): Call

Creates an OkHttp Call for a request with the specified HttpUrl.