KVIrc
4.9.2
DeveloperAPIs
|
The QHttpResponseHeader class contains response header information for HTTP. More...
#include <qhttp.h>
Public Member Functions | |
int | majorVersion () const |
int | minorVersion () const |
QHttpResponseHeader & | operator= (const QHttpResponseHeader &header) |
QHttpResponseHeader () | |
QHttpResponseHeader (const QHttpResponseHeader &header) | |
QHttpResponseHeader (const QString &str) | |
QHttpResponseHeader (int code, const QString &text=QString(), int majorVer=1, int minorVer=1) | |
QString | reasonPhrase () const |
void | setStatusLine (int code, const QString &text=QString(), int majorVer=1, int minorVer=1) |
int | statusCode () const |
QString | toString () const |
Public Member Functions inherited from QHttpHeader | |
void | addValue (const QString &key, const QString &value) |
QStringList | allValues (const QString &key) const |
uint | contentLength () const |
QString | contentType () const |
bool | hasContentLength () const |
bool | hasContentType () const |
bool | hasKey (const QString &key) const |
bool | isValid () const |
QStringList | keys () const |
QHttpHeader & | operator= (const QHttpHeader &h) |
QHttpHeader () | |
QHttpHeader (const QHttpHeader &header) | |
QHttpHeader (const QString &str) | |
void | removeAllValues (const QString &key) |
void | removeValue (const QString &key) |
void | setContentLength (int len) |
void | setContentType (const QString &type) |
void | setValue (const QString &key, const QString &value) |
void | setValues (const QList< QPair< QString, QString >> &values) |
QString | value (const QString &key) const |
QList< QPair< QString, QString > > | values () const |
virtual | ~QHttpHeader () |
Protected Member Functions | |
bool | parseLine (const QString &line, int number) |
Protected Member Functions inherited from QHttpHeader | |
bool | parse (const QString &str) |
QHttpHeader (QHttpHeaderPrivate &dd, const QString &str=QString()) | |
QHttpHeader (QHttpHeaderPrivate &dd, const QHttpHeader &header) | |
void | setValid (bool) |
Friends | |
class | QHttpPrivate |
Additional Inherited Members | |
Protected Attributes inherited from QHttpHeader | |
QScopedPointer < QHttpHeaderPrivate > | d_ptr |
The QHttpResponseHeader class contains response header information for HTTP.
QtNetwork
This class is used by the QHttp class to report the header information that the client received from the server.
HTTP responses have a status code that indicates the status of the response. This code is a 3-digit integer result code (for details see to RFC 1945). In addition to the status code, you can also specify a human-readable text that describes the reason for the code ("reason phrase"). This class allows you to get the status code and the reason phrase.
QHttpResponseHeader::QHttpResponseHeader | ( | ) |
Constructs an empty HTTP response header.
References QHttpHeader::setValid().
QHttpResponseHeader::QHttpResponseHeader | ( | const QHttpResponseHeader & | header | ) |
Constructs a copy of header.
References d.
QHttpResponseHeader::QHttpResponseHeader | ( | const QString & | str | ) |
Constructs a HTTP response header from the string str. The string is parsed and the information is set. The str should consist of one or more "\r\n" delimited lines; the first line should be the status-line (format: HTTP-version, space, status-code, space, reason-phrase); each of remaining lines should have the format key, colon, space, value.
References QHttpHeader::parse().
QHttpResponseHeader::QHttpResponseHeader | ( | int | code, |
const QString & | text = QString() , |
||
int | majorVer = 1 , |
||
int | minorVer = 1 |
||
) |
Constructs a QHttpResponseHeader, setting the status code to code, the reason phrase to text and the protocol-version to majorVer and minorVer.
References setStatusLine().
|
virtual |
Returns the major protocol-version of the HTTP response header.
Implements QHttpHeader.
References d.
|
virtual |
Returns the minor protocol-version of the HTTP response header.
Implements QHttpHeader.
References d.
QHttpResponseHeader & QHttpResponseHeader::operator= | ( | const QHttpResponseHeader & | header | ) |
Copies the contents of header into this QHttpResponseHeader.
References d, and QHttpHeader::operator=().
|
protectedvirtual |
Reimplemented from QHttpHeader.
References d, l, and QHttpHeader::parseLine().
QString QHttpResponseHeader::reasonPhrase | ( | ) | const |
Returns the reason phrase of the HTTP response header.
References d.
Referenced by KvsObject_http::slotReadyRead(), and KvsObject_http::slotResponseHeaderReceived().
void QHttpResponseHeader::setStatusLine | ( | int | code, |
const QString & | text = QString() , |
||
int | majorVer = 1 , |
||
int | minorVer = 1 |
||
) |
Sets the status code to code, the reason phrase to text and the protocol-version to majorVer and minorVer.
References d, and QHttpHeader::setValid().
Referenced by QHttpResponseHeader().
int QHttpResponseHeader::statusCode | ( | ) | const |
Returns the status code of the HTTP response header.
References d.
Referenced by QHttpPrivate::_q_slotReadyRead(), KvsObject_http::slotReadyRead(), and KvsObject_http::slotResponseHeaderReceived().
|
virtual |
Reimplemented from QHttpHeader.
References d, and QHttpHeader::toString().
Referenced by QHttpPrivate::_q_slotReadyRead().
|
friend |