RequestInit

@JSType
trait RequestInit extends Object

See RequestInit in Fetch API The underlying object is a dictionary. This trait is here to help encode the types.

class Object
trait Any
class Object
trait Matchable
class Any

Value members

Inherited methods

def hasOwnProperty(v: String): Boolean
Inherited from:
Object
def isPrototypeOf(v: Object): Boolean
Inherited from:
Object
def propertyIsEnumerable(v: String): Boolean
Inherited from:
Object
def toLocaleString(): String
Inherited from:
Object
def valueOf(): Any
Inherited from:
Object

Concrete fields

@ExposedJSMember @JSOptional
var body: UndefOr[BodyInit]
@ExposedJSMember @JSOptional
var cache: UndefOr[RequestCache]
@ExposedJSMember @JSOptional
@ExposedJSMember @JSOptional
var duplex: UndefOr[RequestDuplex]

"half" is the only valid value and it is for initiating a half-duplex fetch (i.e., the user agent sends the entire request before processing the response).

"half" is the only valid value and it is for initiating a half-duplex fetch (i.e., the user agent sends the entire request before processing the response).

@ExposedJSMember @JSOptional
var headers: UndefOr[HeadersInit]
@ExposedJSMember @JSOptional
var integrity: UndefOr[String]
@ExposedJSMember @JSOptional
var keepalive: UndefOr[Boolean]
@ExposedJSMember @JSOptional
var method: UndefOr[HttpMethod]
@ExposedJSMember @JSOptional
var mode: UndefOr[RequestMode]
@ExposedJSMember @JSOptional
@ExposedJSMember @JSOptional
var referrer: UndefOr[String]
@ExposedJSMember @JSOptional
@ExposedJSMember @JSOptional
var signal: UndefOr[AbortSignal]
@ExposedJSMember @JSOptional
var window: UndefOr[Null]

The whatwg spec section on RequestInit dictionary has a comment that states that this value "can only be set to null". In the detailed steps section for the Request(input,init) constructor it says even more clearly: "If init's window member is present and it is not null, throw a TypeError."

The whatwg spec section on RequestInit dictionary has a comment that states that this value "can only be set to null". In the detailed steps section for the Request(input,init) constructor it says even more clearly: "If init's window member is present and it is not null, throw a TypeError."