- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Slots | Signals | Public Member Functions | Friends

# QHttp Class Reference

Search for all occurrences

## Detailed Description

Definition at line 173 of file qhttp.h.

`#include <qhttp.h>`

Inheritance diagram for QHttp:
[legend]

List of all members.

## Public Types
enum | ConnectionMode { ConnectionModeHttp, ConnectionModeHttps }
enum | State { Unconnected, HostLookup, Connecting, Sending, Reading, Connected, Closing }
enum | Error { NoError, UnknownError, HostNotFound, ConnectionRefused, UnexpectedClose, InvalidResponseHeader, WrongContentLength, Aborted, AuthenticationRequiredError, ProxyAuthenticationRequiredError }
## Public Slots
void | abort ()
void | ignoreSslErrors ()
## Signals
void | stateChanged (int)
void | responseHeaderReceived (const QHttpResponseHeader &resp)
void | readyRead (const QHttpResponseHeader &resp)
void | dataSendProgress (int, int)
void | dataReadProgress (int, int)
void | requestStarted (int)
void | requestFinished (int, bool)
void | done (bool)
void | proxyAuthenticationRequired (const QNetworkProxy &proxy, QAuthenticator *)
void | authenticationRequired (const QString &hostname, quint16 port, QAuthenticator *)
void | sslErrors (const QList< QSslError > &errors)
## Public Member Functions
| QHttp (QObject *parent=0)
| QHttp (const QString &hostname, quint16 port=80, QObject *parent=0)
| QHttp (const QString &hostname, ConnectionMode mode, quint16 port=0, QObject *parent=0)
virtual | ~QHttp ()
int | setHost (const QString &hostname, quint16 port=80)
int | setHost (const QString &hostname, ConnectionMode mode, quint16 port=0)
int | setSocket (QTcpSocket *socket)
int | setUser (const QString &username, const QString &password=QString())
int | setProxy (const QString &host, int port, const QString &username=QString(), const QString &password=QString())
int | setProxy (const QNetworkProxy &proxy)
int | get (const QString &path, QIODevice *to=0)
int | post (const QString &path, QIODevice *data, QIODevice *to=0)
int | post (const QString &path, const QByteArray &data, QIODevice *to=0)
int | head (const QString &path)
int | request (const QHttpRequestHeader &header, QIODevice *device=0, QIODevice *to=0)
int | request (const QHttpRequestHeader &header, const QByteArray &data, QIODevice *to=0)
int | closeConnection ()
int | close ()
qint64 | bytesAvailable () const
qint64 | read (char *data, qint64 maxlen)
QByteArray | readAll ()
int | currentId () const
QIODevice * | currentSourceDevice () const
QIODevice * | currentDestinationDevice () const
QHttpRequestHeader | currentRequest () const
QHttpResponseHeader | lastResponse () const
bool | hasPendingRequests () const
void | clearPendingRequests ()
State | state () const
Error | error () const
QString | errorString () const
## Friends
class | QHttpSetHostRequest
class | QHttpSetSocketRequest
class | QHttpSetUserRequest
class | QHttpSetProxyRequest
class | QHttpCloseRequest
class | QHttpPGHRequest

## Member Enumeration Documentation

enum ConnectionMode

Search for all occurrences

Enumerator:

  ConnectionModeHttp | Search for all occurrences
  ConnectionModeHttps | Search for all occurrences

Definition at line 178 of file qhttp.h.

                            {
            ConnectionModeHttp,
            ConnectionModeHttps
        };

enum State

Search for all occurrences

Enumerator:

  Unconnected | Search for all occurrences
  HostLookup | Search for all occurrences
  Connecting | Search for all occurrences
  Sending | Search for all occurrences
  Reading | Search for all occurrences
  Connected | Search for all occurrences
  Closing | Search for all occurrences

Definition at line 188 of file qhttp.h.

                   {
            Unconnected,
            HostLookup,
            Connecting,
            Sending,
            Reading,
            Connected,
            Closing
        };

enum Error

Search for all occurrences

Enumerator:

  NoError | Search for all occurrences
  UnknownError | Search for all occurrences
  HostNotFound | Search for all occurrences
  ConnectionRefused | Search for all occurrences
  UnexpectedClose | Search for all occurrences
  InvalidResponseHeader | Search for all occurrences
  WrongContentLength | Search for all occurrences
  Aborted | Search for all occurrences
  AuthenticationRequiredError | Search for all occurrences
  ProxyAuthenticationRequiredError | Search for all occurrences

Definition at line 197 of file qhttp.h.

                   {
            NoError,
            UnknownError,
            HostNotFound,
            ConnectionRefused,
            UnexpectedClose,
            InvalidResponseHeader,
            WrongContentLength,
            Aborted,
            AuthenticationRequiredError,
            ProxyAuthenticationRequiredError
        };

## Constructor & Destructor Documentation

QHttp | ( | QObject * | parent = `0` | ) | `[explicit]`

QHttp | ( | const QString & | hostname,
|  | quint16 | port = `80`,
|  | QObject * | parent = `0`
| ) |  |

QHttp | ( | const QString & | hostname,
|  | ConnectionMode | mode,
|  | quint16 | port = `0`,
|  | QObject * | parent = `0`
| ) |  |

virtual ~QHttp | ( |  | ) | `[virtual]`

## Member Function Documentation

int setHost | ( | const QString & | hostname,
|  | quint16 | port = `80`
| ) |  |

Search for all occurrences

int setHost | ( | const QString & | hostname,
|  | ConnectionMode | mode,
|  | quint16 | port = `0`
| ) |  |

Search for all occurrences

int setSocket | ( | QTcpSocket * | socket | ) |

Search for all occurrences

int setUser | ( | const QString & | username,
|  | const QString & | password = `QString()`
| ) |  |

Search for all occurrences

int setProxy | ( | const QString & | host,
|  | int | port,
|  | const QString & | username = `QString()`,
|  | const QString & | password = `QString()`
| ) |  |

Search for all occurrences

int setProxy | ( | const QNetworkProxy & | proxy | ) |

Search for all occurrences

int get | ( | const QString & | path,
|  | QIODevice * | to = `0`
| ) |  |

Search for all occurrences

int post | ( | const QString & | path,
|  | QIODevice * | data,
|  | QIODevice * | to = `0`
| ) |  |

Search for all occurrences

int post | ( | const QString & | path,
|  | const QByteArray & | data,
|  | QIODevice * | to = `0`
| ) |  |

Search for all occurrences

int head | ( | const QString & | path | ) |

Search for all occurrences

int request | ( | const QHttpRequestHeader & | header,
|  | QIODevice * | device = `0`,
|  | QIODevice * | to = `0`
| ) |  |

Search for all occurrences

int request | ( | const QHttpRequestHeader & | header,
|  | const QByteArray & | data,
|  | QIODevice * | to = `0`
| ) |  |

Search for all occurrences

int closeConnection | ( |  | ) |

Search for all occurrences

int close | ( |  | ) |

Search for all occurrences

qint64 bytesAvailable | ( |  | ) | const

Search for all occurrences

qint64 read | ( | char * | data,
|  | qint64 | maxlen
| ) |  |

Search for all occurrences

QByteArray readAll | ( |  | ) |

Search for all occurrences

int currentId | ( |  | ) | const

Search for all occurrences

QIODevice* currentSourceDevice | ( |  | ) | const

Search for all occurrences

QIODevice* currentDestinationDevice | ( |  | ) | const

Search for all occurrences

QHttpRequestHeader currentRequest | ( |  | ) | const

Search for all occurrences

QHttpResponseHeader lastResponse | ( |  | ) | const

Search for all occurrences

bool hasPendingRequests | ( |  | ) | const

Search for all occurrences

void clearPendingRequests | ( |  | ) |

Search for all occurrences

State state | ( |  | ) | const

Search for all occurrences

Error error | ( |  | ) | const

Search for all occurrences

QString errorString | ( |  | ) | const

Search for all occurrences

void abort | ( |  | ) | `[slot]`

Search for all occurrences

void ignoreSslErrors | ( |  | ) | `[slot]`

Search for all occurrences

void stateChanged | ( | int |  | ) | `[signal]`

Search for all occurrences

void responseHeaderReceived | ( | const QHttpResponseHeader & | resp | ) | `[signal]`

Search for all occurrences

void readyRead | ( | const QHttpResponseHeader & | resp | ) | `[signal]`

Search for all occurrences

void dataSendProgress | ( | int | ,
|  | int |
| ) |  | `[signal]`

Search for all occurrences

void dataReadProgress | ( | int | ,
|  | int |
| ) |  | `[signal]`

Search for all occurrences

void requestStarted | ( | int |  | ) | `[signal]`

Search for all occurrences

void requestFinished | ( | int | ,
|  | bool |
| ) |  | `[signal]`

Search for all occurrences

void done | ( | bool |  | ) | `[signal]`

Search for all occurrences

void proxyAuthenticationRequired | ( | const QNetworkProxy & | proxy,
|  | QAuthenticator * |
| ) |  | `[signal]`

Search for all occurrences

void authenticationRequired | ( | const QString & | hostname,
|  | quint16 | port,
|  | QAuthenticator * |
| ) |  | `[signal]`

Search for all occurrences

void sslErrors | ( | const QList< QSslError > & | errors | ) | `[signal]`

Search for all occurrences

## Friends And Related Function Documentation

friend class QHttpSetHostRequest `[friend]`

Search for all occurrences

Definition at line 301 of file qhttp.h.

friend class QHttpSetSocketRequest `[friend]`

Search for all occurrences

Definition at line 302 of file qhttp.h.

friend class QHttpSetUserRequest `[friend]`

Search for all occurrences

Definition at line 303 of file qhttp.h.

friend class QHttpSetProxyRequest `[friend]`

Search for all occurrences

Definition at line 304 of file qhttp.h.

friend class QHttpCloseRequest `[friend]`

Search for all occurrences

Definition at line 305 of file qhttp.h.

friend class QHttpPGHRequest `[friend]`

Search for all occurrences

Definition at line 306 of file qhttp.h.

The documentation for this class was generated from the following file:

- QtNetwork/qhttp.h

QHttp QHttp QHttp QHttp QHttp QHttp QHttp QHttp QHttp QHttp
QHttp QHttp QHttp QHttp QHttp QHttp QHttp QHttp QHttp QHttp