QWebEngineHttpRequest¶
The
QWebEngineHttpRequest
class holds a request to be sent with WebEngine . More…
Synopsis¶
Functions¶
Static functions¶
def
postRequest
(url, postData)
Detailed Description¶
QWebEngineHttpRequest
represents an HTTP request in the WebEngine networking stack. It holds the information necessary to send a request over the network. It contains a URL and some ancillary information that can be used to modify the request. Bothload()
andload()
accept aQWebEngineHttpRequest
as a parameter.
- class PySide2.QtWebEngineCore.QWebEngineHttpRequest([url=QUrl()[, method=QWebEngineHttpRequest.Get]])¶
PySide2.QtWebEngineCore.QWebEngineHttpRequest(other)
- param url:
- param method:
- param other:
Constructs a
QWebEngineHttpRequest
object withurl
as the URL to be requested andmethod
as the method to be used.Creates a copy of
other
.
- PySide2.QtWebEngineCore.QWebEngineHttpRequest.Method¶
This enum type describes the method used to send the HTTP request:
Constant
Description
QWebEngineHttpRequest.Get
The GET method.
QWebEngineHttpRequest.Post
The POST method.
- PySide2.QtWebEngineCore.QWebEngineHttpRequest.hasHeader(headerName)¶
- Parameters:
headerName –
PySide2.QtCore.QByteArray
- Return type:
bool
Returns
true
if the headerheaderName
is present in this WebEngine request.See also
- PySide2.QtWebEngineCore.QWebEngineHttpRequest.header(headerName)¶
- Parameters:
headerName –
PySide2.QtCore.QByteArray
- Return type:
Returns the header specified by
headerName
. If no such header is present, an emptyQByteArray
is returned, which may be indistinguishable from a header that is present but has no content (usehasHeader()
to find out if the header exists or not).Headers can be set with
setHeader()
.See also
- PySide2.QtWebEngineCore.QWebEngineHttpRequest.headers()¶
- Return type:
Returns a list of all headers that are set in this WebEngine request. The list is in the order that the headers were set.
See also
- PySide2.QtWebEngineCore.QWebEngineHttpRequest.method()¶
- Return type:
Returns the method this WebEngine request is using.
See also
- PySide2.QtWebEngineCore.QWebEngineHttpRequest.__ne__(other)¶
- Parameters:
- Return type:
bool
Returns
false
if this object is not the same asother
.See also
operator==()
- PySide2.QtWebEngineCore.QWebEngineHttpRequest.__eq__(other)¶
- Parameters:
- Return type:
bool
Returns
true
if this object is the same asother
(that is, if they have the same method, URL, and headers).See also
operator!=()
- PySide2.QtWebEngineCore.QWebEngineHttpRequest.postData()¶
- Return type:
Returns the (raw) POST data this WebEngine request contains.
See also
- static PySide2.QtWebEngineCore.QWebEngineHttpRequest.postRequest(url, postData)¶
- Parameters:
url –
PySide2.QtCore.QUrl
postData –
- Return type:
Constructs a
QWebEngineHttpRequest
tourl
that uses the POST method.Note
postData
may contain arbitrary strings. They are translated to appropriate raw data.See also
- PySide2.QtWebEngineCore.QWebEngineHttpRequest.setHeader(headerName, value)¶
- Parameters:
headerName –
PySide2.QtCore.QByteArray
value –
PySide2.QtCore.QByteArray
Sets the header
headerName
to be of valueheaderValue
.Note
Setting the same header twice overrides the previous setting. To accomplish the behavior of multiple HTTP headers of the same name, you should concatenate the two values, separating them with a comma (“,”) and set one single header.
See also
- PySide2.QtWebEngineCore.QWebEngineHttpRequest.setMethod(method)¶
- Parameters:
method –
Method
Sets the method this WebEngine request is using to be
method
.See also
- PySide2.QtWebEngineCore.QWebEngineHttpRequest.setPostData(postData)¶
- Parameters:
postData –
PySide2.QtCore.QByteArray
Sets the (raw) POST data this WebEngine request contains to be
postData
.See also
- PySide2.QtWebEngineCore.QWebEngineHttpRequest.setUrl(url)¶
- Parameters:
url –
PySide2.QtCore.QUrl
Sets the URL this WebEngine request is referring to be
url
.See also
- PySide2.QtWebEngineCore.QWebEngineHttpRequest.swap(other)¶
- Parameters:
Swaps this WebEngine request with
other
. This function is very fast and never fails.
- PySide2.QtWebEngineCore.QWebEngineHttpRequest.unsetHeader(headerName)¶
- Parameters:
headerName –
PySide2.QtCore.QByteArray
Removes the header specified by
key
, if present.See also
- PySide2.QtWebEngineCore.QWebEngineHttpRequest.url()¶
- Return type:
Returns the URL this WebEngine request is referring to.
See also
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.