WebConnections
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:
- The connection stage. One of
'Connecting','Waiting','ResponseReady','Done'and'Closed'. - HTTP code
- HTTP status text
- Response headers
- 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.
Enable comment auto-refresher