# QHttp Class Reference

### [com.trolltech.qt.network package]

Inherits QObject.

### Constructor

- void QHttp(QObject parent)
- void QHttp(String hostname, ConnectionMode mode, unsigned short port, QObject parent)
- void QHttp(String hostname, unsigned short port, QObject parent)

### Constructor Properties

- prototype: The QHttp prototype object
- NoError
- UnknownError
- HostNotFound
- ConnectionRefused
- UnexpectedClose
- InvalidResponseHeader
- WrongContentLength
- Aborted
- AuthenticationRequiredError
- ProxyAuthenticationRequiredError
- Error( value )
- ConnectionModeHttp
- ConnectionModeHttps
- ConnectionMode( value )
- Unconnected
- HostLookup
- Connecting
- Sending
- Reading
- Connected
- Closing
- State( value )

### Prototype Object Properties

The QHttp prototype object inherits properties from the QObject prototype object and also has the following properties.

- qint64 bytesAvailable()
- void clearPendingRequests()
- int close()
- QIODevice currentDestinationDevice()
- int currentId()
- QHttpRequestHeader currentRequest()
- QIODevice currentSourceDevice()
- Error error()
- String errorString()
- int get(String path, QIODevice to)
- bool hasPendingRequests()
- int head(String path)
- QHttpResponseHeader lastResponse()
- int post(String path, QIODevice data, QIODevice to)
- qint64 read(char data, qint64 maxlen)
- QByteArray readAll()
- int request(QHttpRequestHeader header, QIODevice device, QIODevice to)
- int setHost(String hostname, ConnectionMode mode, unsigned short port)
- int setProxy(QNetworkProxy proxy)
- int setSocket(QTcpSocket socket)
- int setUser(String username, String password)
- State state()

### Instance Properties

QHttp objects have no special properties beyond those inherited from the QHttp prototype object.