Tilde Friends server-side HTTP client.
◆ fetch()
function export fetch |
( |
|
url, |
|
|
|
options, |
|
|
|
allowed_hosts |
|
) |
| |
Make an HTTP request.
- Parameters
-
url | The URL. |
options | Request options. |
allowed_hosts | List 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
-
data | The response data, headers and body included. |
- Returns
- headers and body data.
◆ parseUrl()
Parse a URL into protocol, host, path, and port parts.
- Parameters
-
- Returns
- An object of the URL parts.