You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FetchOptions | Mokapi HTTP Module Function Parameters
description
The FetchOptions object defines parameters for the fetch() function in Mokapi's HTTP module, including method, headers, body, timeout, and redirect settings.
FetchOptions
The FetchOptions object defines additional parameters for the fetch() function in the mokapi/http module.
It allows you to customize request behavior such as HTTP method, headers, body, timeout, and redirect handling.
Name
Type
Description
method
string
The HTTP method used for the request (e.g. "GET", "POST", "PUT"). Defaults to "GET".
body
any
The request body to send. Automatically serialized to JSON when Content-Type is set to application/json.
headers
object
Key-value pairs representing HTTP headers to include with the request.
maxRedirects
number
The number of redirects to follow. Default value is 5. A value of 0 (zero) prevents all redirection.
timeout
number, string
Maximum time to wait for the request to complete. Default timeout is 60 seconds ("60s")
insecure
boolean
If set to true, TLS certificate verification is skipped. This allows connections to servers with self-signed or invalid certificates. Default is false.