PySide6.QtHttpServer.QHttpServerRequest¶
- class QHttpServerRequest¶
封装一个HTTP请求。更多…
概要¶
方法¶
def
body()
def
headers()
def
localAddress()
def
localPort()
def
method()
def
query()
def
remoteAddress()
def
remotePort()
def
url()
def
value()
注意
本文档可能包含从C++自动翻译到Python的代码片段。我们始终欢迎对代码片段翻译的贡献。如果您发现翻译问题,您也可以通过在我们的https:/bugreports.qt.io/projects/PYSIDE上创建工单来告知我们。
详细描述¶
用于访问传入请求的不同参数的API。
- class Method¶
(继承自
enum.Flag
) 此枚举类型指定了一个HTTP请求方法:常量
描述
QHttpServerRequest.Method.Unknown
未知的方法。
QHttpServerRequest.Method.Get
HTTP GET 方法。
QHttpServerRequest.Method.Put
HTTP PUT 方法。
QHttpServerRequest.Method.Delete
HTTP DELETE 方法。
QHttpServerRequest.Method.Post
HTTP POST 方法。
QHttpServerRequest.Method.Head
HTTP HEAD 方法。
QHttpServerRequest.Method.Options
HTTP OPTIONS 方法。
QHttpServerRequest.Method.Patch
HTTP PATCH 方法 ( RFC 5789 ).
QHttpServerRequest.Method.Connect
HTTP CONNECT 方法。
QHttpServerRequest.Method.Trace
HTTP TRACE 方法。
QHttpServerRequest.Method.AnyKnown
所有已知方法的组合。
- body()¶
- Return type:
返回请求的主体。
- headers()¶
- Return type:
- localAddress()¶
- Return type:
返回接收请求的本地套接字的主机地址。
- localPort()¶
- Return type:
整数
返回接收请求的本地套接字的端口。
返回请求的方法。
返回请求中的查询。
- remoteAddress()¶
- Return type:
返回请求的原始主机的地址。
- remotePort()¶
- Return type:
整数
返回请求的原始主机的端口。
- sslConfiguration()¶
- Return type:
返回已建立的TLS连接的配置。如果连接未使用TLS,则配置的isNull()将返回true。
返回请求所要求的URL。
- value(key)¶
- Parameters:
key –
QByteArray
- Return type:
返回所有具有指定
key
的头的组合值。