WebConnections

Revision as of 22:31, 19 March 2024 by Lchrisman (talk | contribs) (Created page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

A «webConnection» is a special data object returned by ReadFromUrl when you open an asynchronous communication channel. There are three types of asynchronous connections: a fully asynchronous (RESTful) connection, a streaming Server-Sent Events (SSE) connection, and a websocket connection.

Once you have a «webConnection» object, you interact with it using the methods described on this page. These start with underscores since they are somewhat esoteric and aren't of use in a broader scope -- they are only used as methods of a «webConnection».

Function _WebConnectionStatus( wc )

The «wc» parameter is a «webConnection» object return by ReadFromUrl.

Returns the current status of a web connection. In general, there are multiple return values:

  1. The connection stage. One of 'Connecting', 'Waiting', 'ResponseReady', 'Done' and 'Closed'.
  2. HTTP code
  3. HTTP status text
  4. Response headers
  5. Content-type

When using an asynchronous communication channel, you will want to test the status to make sure it hasn't closed, or (if you want to work on something else) that a response is ready to be read. When a response is ready, _WebConnectionRead will return it immediately.

Function _WebConnectionClose( wc )

Function _WebConnectionRead( wc, block )

Function _WebConnectionSend( wc, message )

Comments


You are not allowed to post comments.