ISimpleHttp
Description
- Derived from
- Extended by
-
SimpleHttp sealed
The ISimpleHttp interface provides methods for performing synchronous HTTP
/HTTPS
requests for small binary resources, images and plain text.
When a ISimpleHttp object is disposed, all pending requests will be cancelled.
Public / Methods
Cancel
Cancels all pending HTTP requests.
A cancelled HTTP request has a SimpleHttpResult.StatusCode of 0
and an SimpleHttpResult.Error of IOError.Cancelled.
GetBytes
Performs an HTTP/1.1 GET request on the given binary resource byte range.
On success, exactly SimpleHttpResult.Length bytes have been written to buffer in. If the given byte range is empty (i.e. to opt is less than or equal to from opt), the entire content is to be returned.
Less data may be returned if the given byte range exceeds the file size, or if all remaining bytes in buffer in have already been written to.
If the byte range is not empty and lies outside of the file range, the HTTP server is supposed to return the status code 416:Requested Range Not Satisfiable'
. This must be taken into account when GET
-ing consecutive byte chunks up to the end-of-file, since the from opt parameter could become equal to the file size.
Public / Attributes
Timeout
The request timeout.
The default timeout value is 15000
(i.e. 15 seconds).
An HTTP request that has timed out has a SimpleHttpResult.StatusCode of 0
and an SimpleHttpResult.Error of IOError.TimeOut
- IOException
-
If an I/O error has occurred.