Tilde Friends
Tilde Friends HTTP Client JS

Functions

function parseUrl (url)
 
function parseResponse (data)
 
function export fetch (url, options, allowed_hosts)
 

Detailed Description

Tilde Friends server-side HTTP client.

Function Documentation

◆ fetch()

function export fetch (   url,
  options,
  allowed_hosts 
)

Make an HTTP request.

Parameters
urlThe URL.
optionsRequest options.
allowed_hostsList of allowed hosts.
Returns
A promise resolved with the response headers and body.

◆ parseResponse()

function parseResponse (   data)

Parse an HTTP response into headers and body content.

Parameters
dataThe response data, headers and body included.
Returns
headers and body data.

◆ parseUrl()

function parseUrl (   url)

Parse a URL into protocol, host, path, and port parts.

Parameters
url
Returns
An object of the URL parts.