Provides the collection of all network related items from the Deno / Web
Browser APIs. Any communication you need to make with a backend server
are handled via this namespace. If you need to build a backend server this
namespace will also provide it.
- Source:
- See:
-
- https://developer.mozilla.org/en-US/docs/Web/API/Beacon_API
- https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel
- https://developer.mozilla.org/en-US/docs/Web/API/EventSource
- https://developer.mozilla.org/en-US/docs/Web/API/Window/fetch
- https://developer.mozilla.org/en-US/docs/Web/API/RequestInit
- https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
Members
(static, readonly, nullable) online :boolean
Determines if a connection to the Internet exists. Will return null
on Deno runtime.
Type:
- boolean
- Source:
Methods
(static) beacon(params)
Sends an HTTP POST request containing a small amount of data to a web
server. It's intended to be used for sending analytics data to a web
server, and avoids some of the problems with legacy techniques for
sending analytics, such as the use of XMLHttpRequest.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
object | The named parameters
Properties
|
- Source:
Throws:
-
This is only available on Web Browser runtime.
- Type
- SyntaxError
(static) broadcastChannel(params) → {CBroadcastChannel}
Constructs a CBroadcastChannel object for posting messages between
pages within the same domain.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
params |
object | The named parameters
Properties
|
- Source:
Throws:
-
if attempting to utilizing this object on Deno runtime.
- Type
- SyntaxError
Returns:
- Type
- CBroadcastChannel
(static) fetch(params) → {Promise.<CFetchResponse>}
Implements the ability to fetch a server's REST API endpoint to retrieve
and manage data. The actions for the REST API are controlled via the
specified action value with optional items to pass to the
endpoint. The result is a CFetchResponse wrapping the REST API endpoint
response to the request.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
object | The named parameters
Properties
|
Returns:
The result of the fetch.
- Type
- Promise.<CFetchResponse>
(static) serverSentEvents(params) → {CEventSource}
Constructs a CEventSource object to open a dedicated connection to a
HTTP server to receive messages only.
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
object | The named parameters
Properties
|
- Source:
Returns:
The constructed object.
- Type
- CEventSource
(static) windowMessenger(params) → {CWindowMessenger}
Constructs a CWindowMessenger object to allow for communication
between pages.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
params |
object | The named parameters
Properties
|
- Source:
Throws:
-
If you call this within a Deno runtime.
- Type
- SyntaxError
Returns:
The window messenger.
- Type
- CWindowMessenger