HTTP

The Http package contains various functions and events for performing and responding to HTTP requests.

HTTP

Endpoint

Listens for http requests on the provided path and method. path is an url of the form some/path/, which can be parameterized by :name for path items, and ?query_name&another_query_name for query values. Example: 'user/:name?email&joined_date' This creates name, email and joined_date output properties that one can use to get these values from the request. NOTE: All endpoints currently shares a single http server.

Response

Responds to an HTTP request provided by an Http.Endpoint event. This function must be called downstream from an Http.Endpoint in order to have anything to respond to.

Fetch

Performs a simple http/https request to the provided url and returns the response as a string, buffer or object depending on the value of response type, which can be 'text', 'buffer' or 'json'. The body input will be converted to json if it is anything other than a String or Null.

FetchStreamed

Performs an http request to the given url, expecting it to respond with a SSE-stream, messages from which can be read using Http.NextMessage.

NextMessage

Reads the next message from the SSE stream. This function must be called downstream from a call to `Http.FetchUrlStreamed`.

Url

UrlEncodeFormData

UrlEncodeString

UrlDecodeString

UrlDecodeComponent

Advanced

Client

The Http Clientmodule contains a lower level API for performing Http requests. Http FetchUrl and Http FetchStreamed should cover most use-cases.

OpenNetworkStream

Opens a new network stream.

CreateRequest

SendRequest

ResponseBodyStream

Streams content from a response body as descrete events.

ResponseStatus

ResponseHeaders

ResponseBody

Last updated

Was this helpful?