46 #include <qstringlist.h>
49 #include <qscopedpointer.h>
50 #include <qtcpsocket.h>
76 void addValue(
const QString & key,
const QString & value);
77 QList<QPair<QString, QString>>
values()
const;
78 bool hasKey(
const QString & key)
const;
79 QStringList
keys()
const;
80 QString
value(
const QString & key)
const;
81 QStringList
allValues(
const QString & key)
const;
101 virtual bool parseLine(
const QString & line,
int number);
102 bool parse(
const QString & str);
107 QScopedPointer<QHttpHeaderPrivate>
d_ptr;
120 QHttpResponseHeader(
int code,
const QString & text = QString(),
int majorVer = 1,
int minorVer = 1);
123 void setStatusLine(
int code,
const QString & text = QString(),
int majorVer = 1,
int minorVer = 1);
134 bool parseLine(
const QString & line,
int number);
146 QHttpRequestHeader(
const QString & method,
const QString & path,
int majorVer = 1,
int minorVer = 1);
151 void setRequest(
const QString & method,
const QString & path,
int majorVer = 1,
int minorVer = 1);
153 QString method()
const;
154 QString path()
const;
162 bool parseLine(
const QString & line,
int number);
179 explicit QHttp(QObject * parent = 0);
180 QHttp(
const QString &
hostname, quint16 port = 80, QObject * parent = 0);
181 QHttp(
const QString &
hostname, ConnectionMode mode, quint16 port = 0, QObject * parent = 0);
205 ProxyAuthenticationRequiredError
208 int setHost(
const QString &
hostname, quint16 port = 80);
209 int setHost(
const QString &
hostname, ConnectionMode mode, quint16 port = 0);
211 int setSocket(QTcpSocket * socket);
212 int setUser(
const QString & username,
const QString & password = QString());
214 #ifndef QT_NO_NETWORKPROXY
215 int setProxy(
const QString & host,
int port,
216 const QString & username = QString(),
217 const QString & password = QString());
218 int setProxy(
const QNetworkProxy & proxy);
221 int get(
const QString & path, QIODevice * to = 0);
222 int post(
const QString & path, QIODevice * data, QIODevice * to = 0);
223 int post(
const QString & path,
const QByteArray & data, QIODevice * to = 0);
224 int head(
const QString & path);
225 int request(
const QHttpRequestHeader & header, QIODevice * device = 0, QIODevice * to = 0);
226 int request(
const QHttpRequestHeader & header,
const QByteArray & data, QIODevice * to = 0);
228 int closeConnection();
231 qint64 bytesAvailable()
const;
232 qint64 read(
char * data, qint64 maxlen);
233 QByteArray readAll();
235 int currentId()
const;
236 QIODevice * currentSourceDevice()
const;
237 QIODevice * currentDestinationDevice()
const;
240 bool hasPendingRequests()
const;
241 void clearPendingRequests();
246 QString errorString()
const;
251 #ifndef QT_NO_OPENSSL
252 void ignoreSslErrors();
256 void stateChanged(
int);
261 void dataSendProgress(
int,
int);
262 void dataReadProgress(
int,
int);
264 void requestStarted(
int);
265 void requestFinished(
int,
bool);
268 #ifndef QT_NO_NETWORKPROXY
269 void proxyAuthenticationRequired(
const QNetworkProxy & proxy, QAuthenticator *);
271 void authenticationRequired(
const QString &
hostname, quint16 port, QAuthenticator *);
273 #ifndef QT_NO_OPENSSL
274 void sslErrors(
const QList<QSslError> & errors);
278 Q_DISABLE_COPY(
QHttp)
281 void _q_startNextRequest();
282 void _q_slotReadyRead();
283 void _q_slotConnected();
284 void _q_slotError(QAbstractSocket::SocketError
e);
285 void _q_slotClosed();
286 void _q_slotBytesWritten(qint64 numBytes);
287 #ifndef QT_NO_OPENSSL
288 void _q_slotEncryptedBytesWritten(qint64 numBytes);
290 void _q_slotDoFinished();
291 void _q_slotSendRequest();
292 void _q_continuePost();
State
Definition: qhttp.h:184
ConnectionMode
Definition: qhttp.h:173
State
Definition: NotifierSettings.h:61
Definition: qhttp.cpp:396
Definition: qhttp.cpp:315
Definition: qhttp.cpp:475
QString type()
Definition: KviRuntimeInfo.cpp:646
Definition: qhttp.cpp:346
#define e
Definition: detector.cpp:69
Definition: qhttp.cpp:509
#define h
Definition: detector.cpp:72
char s d
Definition: KviIrcNumericCodes.h:391
void done()
Definition: KviKvs.cpp:50
Definition: qhttp.cpp:434
The QHttp class provides an implementation of the HTTP protocol.
Definition: qhttp.h:168
Error
Definition: qhttp.h:194
Definition: qhttp.cpp:203
QString hostname()
Definition: KviRuntimeInfo.cpp:720