Options Type
Constructors
| Constructor |
Description
|
Full Usage:
Options(?method, ?url, ?headers, ?session, ?partition, ?credentials, ?useSessionCookies, ?protocol, ?host, ?hostname, ?port, ?path, ?redirect, ?origin, ?referrerPolicy, ?cache, ?priority, ?priorityIncremental)
Parameters:
string
-
The HTTP request method. Defaults to the GET method.
?url : string
-
The request URL. Must be provided in the absolute form with the protocol scheme specified as http or https.
?headers : Record<string, U2<string, string[]>>
-
Headers to be sent with the request.
?session : Session
-
The Session instance with which the request is associated.
?partition : string
-
The name of the partition with which the request is associated. Defaults to the empty string. The session option
supersedes partition. Thus if a session is explicitly specified, partition is ignored.
?credentials : Credentials
-
Can be include, omit or same-origin. Whether to send credentials with this request. If set to include, credentials from
the session associated with the request will be used. If set to omit, credentials will not be sent with the
request (and the 'login' event will not be triggered in the event of a 401). If set to same-origin, origin
must also be specified. This matches the behavior of the fetch option of the same name. If this option is
not specified, authentication data from the session will be sent, and cookies will not be sent (unless useSessionCookies is set).
?useSessionCookies : bool
-
Whether to send cookies with this request from the provided session. If credentials is specified, this option has no
effect. Default is false.
?protocol : Protocol
-
Can be http: or https:. The protocol scheme in the form 'scheme:'. Defaults to 'http:'.
?host : string
-
The server host provided as a concatenation of the hostname and the port number 'hostname:port'.
?hostname : string
-
The server host name.
?port : int
-
The server's listening port number.
?path : string
-
The path part of the request URL.
?redirect : Redirect
-
Can be follow, error or manual. The redirect mode for this request. When mode is error, any redirection will
be aborted. When mode is manual the redirection will be cancelled unless request.followRedirect is invoked synchronously during the redirect event.
Defaults to follow.
?origin : string
-
The origin URL of the request.
?referrerPolicy : ReferrerPolicy
-
can be "", no-referrer, no-referrer-when-downgrade, origin, origin-when-cross-origin, unsafe-url, same-origin, strict-origin, or strict-origin-when-cross-origin. Defaults to strict-origin-when-cross-origin.
?cache : Cache
-
can be default, no-store, reload, no-cache, force-cache or only-if-cached.
?priority : Priority
-
can be throttled, idle, lowest, low, medium, or highest. Defaults to idle.
?priorityIncremental : bool
-
the incremental loading flag as part of HTTP extensible priorities (RFC 9218). Default is true.
Returns: Options
|
|
Instance members
| Instance member |
Description
|
Full Usage:
this.cache
|
can be default, no-store, reload, no-cache, force-cache or only-if-cached. |
Full Usage:
this.credentials
|
Can be include, omit or same-origin. Whether to send credentials with this request. If set to include, credentials from the session associated with the request will be used. If set to omit, credentials will not be sent with the request (and the 'login' event will not be triggered in the event of a 401). If set to same-origin, origin must also be specified. This matches the behavior of the fetch option of the same name. If this option is not specified, authentication data from the session will be sent, and cookies will not be sent (unless useSessionCookies is set). |
Full Usage:
this.headers
|
Headers to be sent with the request. |
Full Usage:
this.host
|
The server host provided as a concatenation of the hostname and the port number 'hostname:port'. |
Full Usage:
this.hostname
|
The server host name. |
Full Usage:
this.method
|
The HTTP request method. Defaults to the GET method. |
Full Usage:
this.origin
|
The origin URL of the request. |
Full Usage:
this.partition
|
The name of the partition with which the request is associated. Defaults to the empty string. The session option supersedes partition. Thus if a session is explicitly specified, partition is ignored. |
Full Usage:
this.path
|
The path part of the request URL. |
Full Usage:
this.port
|
The server's listening port number. |
Full Usage:
this.priority
|
can be throttled, idle, lowest, low, medium, or highest. Defaults to idle. |
Full Usage:
this.priorityIncremental
|
the incremental loading flag as part of HTTP extensible priorities (RFC 9218). Default is true. |
Full Usage:
this.protocol
|
Can be http: or https:. The protocol scheme in the form 'scheme:'. Defaults to 'http:'. |
Full Usage:
this.redirect
|
Can be follow, error or manual. The redirect mode for this request. When mode is error, any redirection will be aborted. When mode is manual the redirection will be cancelled unless request.followRedirect is invoked synchronously during the redirect event. Defaults to follow. |
Full Usage:
this.referrerPolicy
|
can be "", no-referrer, no-referrer-when-downgrade, origin, origin-when-cross-origin, unsafe-url, same-origin, strict-origin, or strict-origin-when-cross-origin. Defaults to strict-origin-when-cross-origin. |
Full Usage:
this.session
|
The Session instance with which the request is associated. |
Full Usage:
this.url
|
The request URL. Must be provided in the absolute form with the protocol scheme specified as http or https. |
Full Usage:
this.useSessionCookies
|
Whether to send cookies with this request from the provided session. If credentials is specified, this option has no effect. Default is false. |
fable-electron-docs-api