QWebEngineHttpRequest#
The QWebEngineHttpRequest
class holds a request to be sent with WebEngine . More…
Synopsis#
Functions#
Static functions#
def
postRequest
(url, postData)
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#
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. Both load()
and load()
accept a QWebEngineHttpRequest
as a parameter.
- class PySide6.QtWebEngineCore.QWebEngineHttpRequest([url=QUrl()[, method=QWebEngineHttpRequest.Get]])#
PySide6.QtWebEngineCore.QWebEngineHttpRequest(other)
- Parameters:
method –
Method
url –
PySide6.QtCore.QUrl
Constructs a QWebEngineHttpRequest
object with url
as the URL to be requested and method
as the method to be used.
Creates a copy of other
.
- PySide6.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.
- PySide6.QtWebEngineCore.QWebEngineHttpRequest.hasHeader(headerName)#
- Parameters:
headerName –
PySide6.QtCore.QByteArray
- Return type:
bool
Returns true
if the header headerName
is present in this WebEngine request.
See also
- PySide6.QtWebEngineCore.QWebEngineHttpRequest.header(headerName)#
- Parameters:
headerName –
PySide6.QtCore.QByteArray
- Return type:
Returns the header specified by headerName
. If no such header is present, an empty QByteArray
is returned, which may be indistinguishable from a header that is present but has no content (use hasHeader()
to find out if the header exists or not).
Headers can be set with setHeader()
.
See also
- PySide6.QtWebEngineCore.QWebEngineHttpRequest.headers()#
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
Returns the method this WebEngine request is using.
See also
- PySide6.QtWebEngineCore.QWebEngineHttpRequest.__ne__(other)#
- Parameters:
- Return type:
bool
Returns false
if this object is not the same as other
.
See also
operator==()
- PySide6.QtWebEngineCore.QWebEngineHttpRequest.__eq__(other)#
- Parameters:
- Return type:
bool
Returns true
if this object is the same as other
(that is, if they have the same method, URL, and headers).
See also
operator!=()
- PySide6.QtWebEngineCore.QWebEngineHttpRequest.postData()#
- Return type:
Returns the (raw) POST data this WebEngine request contains.
See also
- static PySide6.QtWebEngineCore.QWebEngineHttpRequest.postRequest(url, postData)#
- Parameters:
url –
PySide6.QtCore.QUrl
postData –
- Return type:
Constructs a QWebEngineHttpRequest
to url
that uses the POST method.
Note
postData
may contain arbitrary strings. They are translated to appropriate raw data.
See also
- PySide6.QtWebEngineCore.QWebEngineHttpRequest.setHeader(headerName, value)#
- Parameters:
headerName –
PySide6.QtCore.QByteArray
value –
PySide6.QtCore.QByteArray
Sets the header headerName
to be of value headerValue
.
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
Sets the method this WebEngine request is using to be method
.
See also
- PySide6.QtWebEngineCore.QWebEngineHttpRequest.setPostData(postData)#
- Parameters:
postData –
PySide6.QtCore.QByteArray
Sets the (raw) POST data this WebEngine request contains to be postData
.
See also
- PySide6.QtWebEngineCore.QWebEngineHttpRequest.setUrl(url)#
- Parameters:
url –
PySide6.QtCore.QUrl
Sets the URL this WebEngine request is referring to be url
.
See also
- PySide6.QtWebEngineCore.QWebEngineHttpRequest.swap(other)#
- Parameters:
Swaps this WebEngine request with other
. This function is very fast and never fails.
- PySide6.QtWebEngineCore.QWebEngineHttpRequest.unsetHeader(headerName)#
- Parameters:
headerName –
PySide6.QtCore.QByteArray
Removes the header specified by key
, if present.
See also
- PySide6.QtWebEngineCore.QWebEngineHttpRequest.url()#
- Return type:
Returns the URL this WebEngine request is referring to.
See also