setRequestHeader

fun setRequestHeader(name: String, value: String)(source)

Combines a header in author request headers.

Throws an "InvalidStateError" DOMException if either state is not opened or the send() flag is set.

Throws a "SyntaxError" DOMException if name is not a header name or if value is not a header value.

MDN Reference