Request

open class Request : Closeable

Request Builder

Constructors

Link copied to clipboard
constructor(builder: Http.QueryBuilder)
Builds a GET request with the specified QueryBuilder
constructor(url: String)
Builds a GET request with the specified url
constructor(url: String, method: String)
Builds a request with the specified url and method

Functions

Link copied to clipboard
open fun close()
Closes this request
Link copied to clipboard
Execute the request
Link copied to clipboard
Execute the request with the specified raw bytes.
Execute the request with the specified body.
Link copied to clipboard
open fun executeWithJson(gson: Gson, body: Any): Http.Response
Execute the request with the specified object as json.
Link copied to clipboard
Execute the request with the specified object as multipart form-data.
open fun executeWithMultipartForm(@NonNull params: Map<String, Any>, doChunkedUploading: Boolean): Http.Response
Link copied to clipboard
Execute the request with the specified object as url encoded form data.
Link copied to clipboard
Performs a GET request to a Discord route
open fun newDiscordRequest(route: String, method: String): Http.Request
Performs a request to a Discord route
Link copied to clipboard
Performs a GET request to a Discord route using RN headers
open fun newDiscordRNRequest(route: String, method: String): Http.Request
Performs a request to a Discord route using RN headers
Link copied to clipboard
Sets whether redirects should be followed
Link copied to clipboard
open fun setHeader(key: String, value: String): Http.Request
Add a header
Link copied to clipboard
open fun setRequestTimeout(timeout: Int): Http.Request
Sets the request connection and read timeout

Properties

Link copied to clipboard
The connection of this Request