QHttpRequestHeader

Inheritance diagram of QHttpRequestHeader

Synopsis

Functions

Detailed Description

The PySide.QtNetwork.QHttpRequestHeader class contains request header information for HTTP.

This class is used in the PySide.QtNetwork.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 PySide.QtNetwork.QHttpRequestHeader.setRequest() . The values can be obtained using PySide.QtNetwork.QHttpRequestHeader.method() , PySide.QtNetwork.QHttpRequestHeader.path() , PySide.QtNetwork.QHttpRequestHeader.majorVersion() and PySide.QtNetwork.QHttpRequestHeader.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() for more information.

Important inherited functions: PySide.QtNetwork.QHttpHeader.setValue() and PySide.QtNetwork.QHttpHeader.value() .

class PySide.QtNetwork.QHttpRequestHeader
class PySide.QtNetwork.QHttpRequestHeader(header)
class PySide.QtNetwork.QHttpRequestHeader(method, path[, majorVer=1[, minorVer=1]])
class PySide.QtNetwork.QHttpRequestHeader(str)
Parameters:

Constructs an empty HTTP request header.

Constructs a copy of header .

Constructs a HTTP request header for the method method , the request-URI path and the protocol-version majorVer and minorVer . The path argument must be properly encoded for an HTTP request.

Constructs a HTTP request header from the string str . The str should consist of one or more “rn” 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.

PySide.QtNetwork.QHttpRequestHeader.method()
Return type:unicode

Returns the method of the HTTP request header.

See also

PySide.QtNetwork.QHttpRequestHeader.path() PySide.QtNetwork.QHttpRequestHeader.majorVersion() PySide.QtNetwork.QHttpRequestHeader.minorVersion() PySide.QtNetwork.QHttpRequestHeader.setRequest()

PySide.QtNetwork.QHttpRequestHeader.path()
Return type:unicode

Returns the request-URI of the HTTP request header.

See also

PySide.QtNetwork.QHttpRequestHeader.method() PySide.QtNetwork.QHttpRequestHeader.majorVersion() PySide.QtNetwork.QHttpRequestHeader.minorVersion() PySide.QtNetwork.QHttpRequestHeader.setRequest()

PySide.QtNetwork.QHttpRequestHeader.setRequest(method, path[, majorVer=1[, minorVer=1]])
Parameters:
  • method – unicode
  • path – unicode
  • majorVerPySide.QtCore.int
  • minorVerPySide.QtCore.int

This function sets the request method to method , the request-URI to path and the protocol-version to majorVer and minorVer . The path argument must be properly encoded for an HTTP request.

See also

PySide.QtNetwork.QHttpRequestHeader.method() PySide.QtNetwork.QHttpRequestHeader.path() PySide.QtNetwork.QHttpRequestHeader.majorVersion() PySide.QtNetwork.QHttpRequestHeader.minorVersion()