http class An implementation of the client side of HTTP protocol.
Inherits
object
Description
This class provides a standard HTTP functionality.
Functions
`<id:integer>$get(<remote_path:string>,[<local_file: string>])`
Sends a get request for path to the server set by $setHost. If local_file is not specified readyRead() signal is emitted every time new content data is available to read.
`<id:integer>$post(<remote_path:string>,<post_data:string>,<local_file: string>`
Sends a post request for path to the server set by $setHost. If local_file is not specified readyRead() signal is emitted every time new content data is available to read.
`$abort()`
Aborts the current request and deletes all scheduled requests.
`<id:integer>$setHost(<host:string>,<remote_port:unsigned_integer>)`
Sets the HTTP server that is used for requests to hostName on port port. The function does not block: the request is scheduled, and its execution is performed asynchronously. The function returns a unique identifier which is passed by requestStartedEvent() and requestFinishedEvent(). When the request is started the requestStarted() signal is emitted. When it is finished the requestFinished() signal is emitted.
`<id:integer>$currentId()`
Returns the identifier of the HTTP request being executed or 0 if there is no request being executed.
`<id:integer> $setProxy(<host:string>,<port:integer>,[<user:string>,<password:string>])`
Enables HTTP proxy support, using the proxy server host on port port. Optionals parameters user and password can be provided if the proxy server requires authentication.
`<id:integer> $setUser(<user:string>,<password:string>)`
This function sets the user name userName and password password for web pages that require authentication.
`<string> $readAll()`
Reads all the bytes from the response content and returns them as string.
`<error:string> $errorString()`
Returns a human-readable description of the last error that occurred.
`$ignoreSslErrors()`
`$requestFinishedEvent(<id:integer>,<error:boolean>)`
This event is triggered by KVIrc when the request identified by <id> has finished.
`$requestStartedEvent(<id:integer>,<error:boolean>)`
This event is triggered by KVIrc when the request identified by <id> has started.
`$responseHeaderReceivedEvent(<response:string>)`
This event is triggered by KVIrc when he HTTP header of a server response is available. The response is passed ad string.
`$doneEvent(<error:boolean>)`
This event is triggered when the last pending request has finished; (it is emitted after the last requests requestFinished() signal).
`$dataReadProgressEvent(<done:integer>,<total:integer>)`
This event is triggered when reads data from a HTTP server. <done> is the amount of data has already arrived and <total> is the total amount of data.
`$dataSendProgressEvent(<done:integer>,<total:integer>)`
This event is triggered when sends data to a HTTP server. <done> is the amount of data has already arrived and <total> is the total amount of data.
`$stateChangedEvent(<connection_state:string>)`
This event is triggered by the framework when the state of the connection changes.
`$readyReadEvent(<response:string>)`
This event is triggered by the framework when there is new data read and there is not file specified in get or post. You can call readAll to reads all the bytes from the response data.
`$sslErrorsEvent(<sslerrors:string>)`
Returns the list of errors that occurred during the SSL handshake. Unless you call ignoreSslErrors() from within a slot connected to the signal emitted by this event, the framework will tear down the connection immediately after emitting the signal.
Signals
`$requestStarted()`
This signal is emitted by the default implementation of $requestStartedEvent.
`$requestFinished()`
This signal is emitted by the default implementation of $requestFinishedEvent.
`$dataSendProgress()`
This signal is emitted by the default implementation of $dataSendProgressEvent.
`$dataReadProgress()`
This signal is emitted by the default implementation of $dataReadProgressEvent.
`$done()`
This signal is emitted by the default implementation of $doneEvent.
`$readyRead()`
This signal is emitted by the default implementation of $readyReadEvent.
`$sslErrors()`
This signal is emitted by the default implementation of $sslErrorsEvent.
`$stateChanged()`
This signal is emitted by the default implementation of $stateChangedEvent.
`$responseHeaderReceived()`
This signal is emitted by the default implementation of $responseHeaderReceivedEvent.

Index, Object Classes