The QHttpRequestHeader class contains request header information for HTTP. 更多...
| 頭: | #include <QHttpRequestHeader> |
| 繼承: | QHttpHeader |
該類已過時。 提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。
| QHttpRequestHeader () | |
| QHttpRequestHeader (const QString & method , const QString & path , int majorVer = 1, int minorVer = 1) | |
| QHttpRequestHeader (const QHttpRequestHeader & header ) | |
| QHttpRequestHeader (const QString & str ) | |
| QString | method () const |
| QString | path () const |
| void | setRequest (const QString & method , const QString & path , int majorVer = 1, int minorVer = 1) |
| QHttpRequestHeader & | operator= (const QHttpRequestHeader & header ) |
| virtual int | majorVersion () const |
| virtual int | minorVersion () const |
| virtual QString | toString () const |
The QHttpRequestHeader class contains request header information for HTTP.
This class is used in the QHttp 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 method (), path (), majorVersion () 和 minorVersion ().
Note that the request-URI must be in the format expected by the HTTP server. That is, all reserved characters must be encoded in %HH (where HH are two hexadecimal digits). See QUrl::toPercentEncoding () 瞭解更多信息。
重要繼承函數: setValue () 和 value ().
另請參閱 QHttpResponseHeader and QHttp .
Constructs an empty HTTP request header.
Constructs a HTTP request header for the method method , the request-URI path and the protocol-version majorVer and minorVer 。 path argument must be properly encoded for an HTTP request.
構造副本為 header .
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
QHttpRequestHeader::
majorVersion
() const
重實現自 QHttpHeader::majorVersion ().
Returns the major protocol-version of the HTTP request header.
另請參閱 minorVersion (), method (), path (),和 setRequest ().
Returns the method of the HTTP request header.
另請參閱 path (), majorVersion (), minorVersion (),和 setRequest ().
[虛擬]
int
QHttpRequestHeader::
minorVersion
() const
重實現自 QHttpHeader::minorVersion ().
Returns the minor protocol-version of the HTTP request header.
另請參閱 majorVersion (), method (), path (),和 setRequest ().
Returns the request-URI of the HTTP request header.
另請參閱 method (), majorVersion (), minorVersion (),和 setRequest ().
This function sets the request method to method , the request-URI to path and the protocol-version to majorVer and minorVer 。 path argument must be properly encoded for an HTTP request.
另請參閱 method (), path (), majorVersion (),和 minorVersion ().
[虛擬]
QString
QHttpRequestHeader::
toString
() const
重實現自 QHttpHeader::toString ().
Copies the content of header 到此 QHttpRequestHeader