Namespace: codemelted_network

codemelted_network

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:

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
Name Type Attributes Description
url string The url hosting the POST
data BodyInit <optional>
The data to send.
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
Name Type Description
name string The name of the broadcast channel.
onMessage COnMessageListener The listener for received messages.
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
Name Type Attributes Description
action string "get", "post", "put", "delete".
url string The server's hosting API endpoint.
adAuctionHeaders boolean <optional>
See RequestInit reference.
body object <optional>
See RequestInit reference.
cache string <optional>
See RequestInit reference.
credentials string <optional>
See RequestInit reference.
headers object <optional>
See RequestInit reference.
integrity string <optional>
See RequestInit reference.
keepalive boolean <optional>
See RequestInit reference.
mode string <optional>
See RequestInit reference.
priority string <optional>
See RequestInit reference.
redirect string <optional>
See RequestInit reference.
referrer string <optional>
See RequestInit reference.
referrerPolicy string <optional>
See RequestInit reference.
signal AbortSignal <optional>
See RequestInit reference.
Source:
See:
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
Name Type Attributes Default Description
url string The URL to open the connection to.
withCredentials boolean <optional>
false Whether to open the connection with credentials.
onMessage COnMessageListener The listener for received messages.
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
Name Type Description
onMessage COnWindowMessageListener The listener for received data.
Source:
Throws:
If you call this within a Deno runtime.
Type
SyntaxError
Returns:
The window messenger.
Type
CWindowMessenger