KVIrc  4.9.2
DeveloperAPIs
Public Member Functions | Protected Member Functions | Friends | List of all members
QHttpResponseHeader Class Reference

The QHttpResponseHeader class contains response header information for HTTP. More...

#include <qhttp.h>

+ Inheritance diagram for QHttpResponseHeader:

Public Member Functions

int majorVersion () const
 
int minorVersion () const
 
QHttpResponseHeaderoperator= (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
 
QHttpHeaderoperator= (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
 

Detailed Description

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.

See also
QHttpRequestHeader, QHttp, {HTTP Example}

Constructor & Destructor Documentation

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 
)
Since
4.1

Constructs a QHttpResponseHeader, setting the status code to code, the reason phrase to text and the protocol-version to majorVer and minorVer.

See also
statusCode() reasonPhrase() majorVersion() minorVersion()

References setStatusLine().

Member Function Documentation

int QHttpResponseHeader::majorVersion ( ) const
virtual

Returns the major protocol-version of the HTTP response header.

See also
minorVersion() statusCode() reasonPhrase()

Implements QHttpHeader.

References d.

int QHttpResponseHeader::minorVersion ( ) const
virtual

Returns the minor protocol-version of the HTTP response header.

See also
majorVersion() statusCode() reasonPhrase()

Implements QHttpHeader.

References d.

QHttpResponseHeader & QHttpResponseHeader::operator= ( const QHttpResponseHeader header)

Copies the contents of header into this QHttpResponseHeader.

References d, and QHttpHeader::operator=().

bool QHttpResponseHeader::parseLine ( const QString &  line,
int  number 
)
protectedvirtual

Reimplemented from QHttpHeader.

References d, l, and QHttpHeader::parseLine().

QString QHttpResponseHeader::reasonPhrase ( ) const

Returns the reason phrase of the HTTP response header.

See also
statusCode() majorVersion() minorVersion()

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 
)
Since
4.1

Sets the status code to code, the reason phrase to text and the protocol-version to majorVer and minorVer.

See also
statusCode() reasonPhrase() majorVersion() minorVersion()

References d, and QHttpHeader::setValid().

Referenced by QHttpResponseHeader().

int QHttpResponseHeader::statusCode ( ) const

Returns the status code of the HTTP response header.

See also
reasonPhrase() majorVersion() minorVersion()

References d.

Referenced by QHttpPrivate::_q_slotReadyRead(), KvsObject_http::slotReadyRead(), and KvsObject_http::slotResponseHeaderReceived().

QString QHttpResponseHeader::toString ( ) const
virtual

Reimplemented from QHttpHeader.

References d, and QHttpHeader::toString().

Referenced by QHttpPrivate::_q_slotReadyRead().

Friends And Related Function Documentation

friend class QHttpPrivate
friend

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