PySide6.QtHttpServer.QHttpServerRequest

class QHttpServerRequest

Encapsulates an HTTP request. More

Synopsis

Methods

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description

API for accessing the different parameters of an incoming request.

class Method

(inherits enum.Flag) This enum type specifies an HTTP request method:

Constant

Description

QHttpServerRequest.Method.Unknown

An unknown method.

QHttpServerRequest.Method.Get

HTTP GET method.

QHttpServerRequest.Method.Put

HTTP PUT method.

QHttpServerRequest.Method.Delete

HTTP DELETE method.

QHttpServerRequest.Method.Post

HTTP POST method.

QHttpServerRequest.Method.Head

HTTP HEAD method.

QHttpServerRequest.Method.Options

HTTP OPTIONS method.

QHttpServerRequest.Method.Patch

HTTP PATCH method ( RFC 5789 ).

QHttpServerRequest.Method.Connect

HTTP CONNECT method.

QHttpServerRequest.Method.Trace

HTTP TRACE method.

QHttpServerRequest.Method.AnyKnown

Combination of all known methods.

body()
Return type:

QByteArray

Returns the body of the request.

headers()
Return type:

QHttpHeaders

localAddress()
Return type:

QHostAddress

Returns the host address of the local socket which received the request.

localPort()
Return type:

int

Returns the port of the local socket which received the request.

method()
Return type:

Method

Returns the method of the request.

query()
Return type:

QUrlQuery

Returns the query in the request.

remoteAddress()
Return type:

QHostAddress

Returns the address of the origin host of the request.

remotePort()
Return type:

int

Returns the port of the origin host of the request.

sslConfiguration()
Return type:

QSslConfiguration

Returns the configuration of the established TLS connection. The configurations will return true for isNull() if the connection is not using TLS.

url()
Return type:

QUrl

Returns the URL the request asked for.

value(key)
Parameters:

keyQByteArray

Return type:

QByteArray

Returns the combined value of all headers with the named key.