NetReplyEvent class | tadsnet.t[112]

Network Reply event. This type of event occurs when we receive a reply to a network request made with sendNetRequest().

`class NetReplyEvent : NetEvent`

Superclass Tree (in declaration order)

`NetReplyEvent`
`NetEvent`
`object`

Subclass Tree

(none)

Global Objects

(none)

Summary of Properties

`evType httpStatusLine redirectLoc replyBody replyHeaders replyHeadersRaw requestID statusCode`

Inherited from `NetEvent` :
`evArgs`

Summary of Methods

`construct`

``

Properties

`evType` OVERRIDDEN | `tadsnet.t[164]`

our default event type is NetEvReply

`httpStatusLine` | `tadsnet.t[211]`

the HTTP status string (the first line of the headers)

`redirectLoc` | `tadsnet.t[234]`

Redirect location, if applicable. By default, this will be nil whether or not a redirection took place, because sendNetRequest() normally follows redirection links transparently, returning only the final result from the final server we're redirected to. However, you can override automatic redirection with an option flag (NetReqNoRedirect) when calling sendNetRequest(). When that option is selected, the function won't follow redirection links at all, but will instead simply return the redirect information as the result from the request. When that happens, this property is set to a string giving the target of the redirect. You can then follow the redirect manually, if desired, by sending a new request to the target given here.

`replyBody` | `tadsnet.t[202]`

the content body from the reply

`replyHeaders` | `tadsnet.t[208]`

the HTTP headers from the reply, as a lookup table indexed by header name

`replyHeadersRaw` | `tadsnet.t[218]`

the HTTP headers from the reply, in the raw text format - this is simply a string of all the headers, separated by CR-LF (\r\n) sequences

`requestID` | `tadsnet.t[171]`

The request identifier. This is the ID value provided by the caller in the call to sendNetRequest(), so that the caller can relate the reply back to the corresponding request.

`statusCode` | `tadsnet.t[199]`

The network status code. This is an integer value indicating whether the request was successful or failed with an error. A negative value is a low-level TADS error indicating that the request couldn't be sent to the server, or that a network error occurred receiving the reply:

-1 - out of memory
-2 - couldn't connect to host
-3 - other network/socket error
-4 - invalid parameters
-5 - error reading the content data to send to the server
-6 - error saving the reply data received from the server
-7 - error retrieving reply headers
-8 - error starting background thread
-100 - other TADS/network error

A positive value means that the network transaction itself was successful, and reflects the status information returned by the network server that handled the request. This must be interpreted according to the protocol used to send the request:

- For HTTP requests, the value is an HTTP status code. A code in the 200 range generally indicates success, while other ranges generally indicate errors.

Methods

`construct (t, id, status, body, headers, loc)`OVERRIDDEN | `tadsnet.t[114]`

construction

Adv3Lite Library Reference Manual
Generated on 13/06/2025 from adv3Lite version 2.2.1