Q3HttpRequestHeader Class

The Q3HttpRequestHeader class contains request header information for HTTP. 更多...

头: #include <Q3HttpRequestHeader>
继承: Q3HttpHeader

公共函数

Q3HttpRequestHeader ()
Q3HttpRequestHeader (const QString & method , const QString & path , int majorVer = 1, int minorVer = 1)
Q3HttpRequestHeader (const Q3HttpRequestHeader & header )
Q3HttpRequestHeader (const QString & str )
QString 方法 () const
QString path () const
void setRequest (const QString & method , const QString & path , int majorVer = 1, int minorVer = 1)

重实现公共函数

virtual int majorVersion () const
virtual int minorVersion () const
virtual QString toString () const

详细描述

The Q3HttpRequestHeader class contains request header information for HTTP.

This class is used in the Q3Http class to report the header information if the client requests something from the server.

HTTP requests have a method which describes the request's action. The most common requests are "GET" and "POST". In addition to the request method the header also includes a request-URI to specify the location for the method to use.

The method, request-URI and protocol-version can be set using a constructor or later using setRequest (). The values can be obtained using 方法 (), path (), majorVersion () 和 minorVersion ().

This class is a Q3HttpHeader subclass so that class's functions, e.g. setValue() , value() , etc. are also available.

另请参阅 Q3HttpResponseHeader and Q3Http .

成员函数文档编制

Q3HttpRequestHeader:: Q3HttpRequestHeader ()

Constructs an empty HTTP request header.

Q3HttpRequestHeader:: Q3HttpRequestHeader (const QString & method , const QString & path , int majorVer = 1, int minorVer = 1)

Constructs a HTTP request header for the method method , the request-URI path and the protocol-version majorVer and minorVer .

Q3HttpRequestHeader:: Q3HttpRequestHeader (const Q3HttpRequestHeader & header )

构造副本为 header .

Q3HttpRequestHeader:: Q3HttpRequestHeader (const QString & str )

Constructs a HTTP request header from the string str str should consist of one or more "\r\n" delimited lines; the first line should be the request-line (format: method, space, request-URI, space HTTP-version); each of the remaining lines should have the format key, colon, space, value.

[虚拟] int Q3HttpRequestHeader:: majorVersion () const

重实现自 Q3HttpHeader::majorVersion ().

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

另请参阅 minorVersion (), 方法 (), path (),和 setRequest ().

QString Q3HttpRequestHeader:: 方法 () const

Returns the method of the HTTP request header.

另请参阅 path (), majorVersion (), minorVersion (),和 setRequest ().

[虚拟] int Q3HttpRequestHeader:: minorVersion () const

重实现自 Q3HttpHeader::minorVersion ().

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

另请参阅 majorVersion (), 方法 (), path (),和 setRequest ().

QString Q3HttpRequestHeader:: path () const

Returns the request-URI of the HTTP request header.

另请参阅 方法 (), majorVersion (), minorVersion (),和 setRequest ().

void Q3HttpRequestHeader:: setRequest (const QString & method , const QString & path , int majorVer = 1, int minorVer = 1)

This function sets the request method to method , the request-URI to path and the protocol-version to majorVer and minorVer .

另请参阅 方法 (), path (), majorVersion (),和 minorVersion ().

[虚拟] QString Q3HttpRequestHeader:: toString () const

重实现自 Q3HttpHeader::toString ().