Request
open class Request(url: String, method: String, headers: Map<String, String>, body: dynamic, referrer: String?, referrerPolicy: dynamic, mode: RequestMode?, credentials: RequestCredentials?, cache: RequestCache?, redirect: RequestRedirect?, integrity: String?, keepalive: Boolean?, reqWindow: Any?, middlewares: List<Middleware>)
Content copied to clipboard
Represents the common fields and attributes of an HTTP request.
Use it to define common headers, error-handling, base url, etc. for a specific API for example. By calling one of the executing methods like get or post a specific request is built from the template and send to the server.
Constructors
Request
Link copied to clipboard
fun Request(url: String = "", method: String = "", headers: Map<String, String> = emptyMap(), body: dynamic = undefined, referrer: String? = undefined, referrerPolicy: dynamic = undefined, mode: RequestMode? = undefined, credentials: RequestCredentials? = undefined, cache: RequestCache? = undefined, redirect: RequestRedirect? = undefined, integrity: String? = undefined, keepalive: Boolean? = undefined, reqWindow: Any? = undefined, middlewares: List<Middleware> = emptyList())
Content copied to clipboard
Functions
acceptJson
Link copied to clipboard
arrayBuffer
Link copied to clipboard
cacheControl
Link copied to clipboard
contentType
Link copied to clipboard
copy
Link copied to clipboard
open fun copy(url: String = this.url, method: String = this.method, headers: Map<String, String> = this.headers, body: dynamic = this.body, referrer: String? = this.referrer, referrerPolicy: dynamic = this.referrerPolicy, mode: RequestMode? = this.mode, credentials: RequestCredentials? = this.credentials, cache: RequestCache? = this.cache, redirect: RequestRedirect? = this.redirect, integrity: String? = this.integrity, keepalive: Boolean? = this.keepalive, reqWindow: Any? = this.reqWindow, middlewares: List<Middleware> = this.middlewares): Request
Content copied to clipboard
creates a copy of the Request.
credentials
Link copied to clipboard
referrerPolicy
Link copied to clipboard
requestMode
Link copied to clipboard
use
Link copied to clipboard
Properties
cache
Link copied to clipboard
credentials
Link copied to clipboard
middlewares
Link copied to clipboard
mode
Link copied to clipboard
redirect
Link copied to clipboard
referrerPolicy
Link copied to clipboard
val referrerPolicy: dynamic
Content copied to clipboard