IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QWebEngineHttpRequest Class

The QWebEngineHttpRequest class holds a request to be sent with WebEngine.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QWebEngineHttpRequest Class▲

  • Header: QWebEngineHttpRequest

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS WebEngineCore)

    target_link_libraries(mytarget PRIVATE Qt6::WebEngineCore)

  • qmake: QT += webenginecore

  • Group: QWebEngineHttpRequest is part of webengine

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 QWebEnginePage::load() and QWebEngineView::load() accept a QWebEngineHttpRequest as a parameter.

Member Type Documentation▲

 

enum QWebEngineHttpRequest::Method▲

This enum type describes the method used to send the HTTP request:

Constant

Value

Description

QWebEngineHttpRequest::Get

0

The GET method.

QWebEngineHttpRequest::Post

1

The POST method.

Member Function Documentation▲

 

[explicit] QWebEngineHttpRequest::QWebEngineHttpRequest(const QUrl &url = QUrl(), const QWebEngineHttpRequest::Method &method = QWebEngineHttpRequest::Get)▲

Constructs a QWebEngineHttpRequest object with url as the URL to be requested and method as the method to be used.

See Also▲

See also url(), setUrl()

QWebEngineHttpRequest::QWebEngineHttpRequest(const QWebEngineHttpRequest &other)▲

Creates a copy of other.

QWebEngineHttpRequest::~QWebEngineHttpRequest()▲

Disposes of the QWebEngineHttpRequest object.

bool QWebEngineHttpRequest::hasHeader(const QByteArray &headerName) const▲

Returns true if the header headerName is present in this WebEngine request.

See Also▲

See also setHeader(), header(), unsetHeader(), headers()

QByteArray QWebEngineHttpRequest::header(const QByteArray &headerName) const▲

Headers can be set with setHeader().

See Also▲

See also setHeader(), hasHeader(), unsetHeader(), headers()

QList<QByteArray> QWebEngineHttpRequest::headers() const▲

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▲

See also setHeader(), header(), hasHeader(), unsetHeader()

QWebEngineHttpRequest::Method QWebEngineHttpRequest::method() const▲

Returns the method this WebEngine request is using.

See Also▲

See also setMethod()

QByteArray QWebEngineHttpRequest::postData() const▲

Returns the (raw) POST data this WebEngine request contains.

See Also▲

See also setPostData()

[static] QWebEngineHttpRequest QWebEngineHttpRequest::postRequest(const QUrl &url, const QMap<QString, QString> &postData)▲

Constructs a QWebEngineHttpRequest to url that uses the POST method.

postData may contain arbitrary strings. They are translated to appropriate raw data.

See Also▲

See also postData, setPostData()

void QWebEngineHttpRequest::setHeader(const QByteArray &headerName, const QByteArray &headerValue)▲

Sets the header headerName to be of value headerValue.

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▲

See also header(), hasHeader(), unsetHeader(), headers()

void QWebEngineHttpRequest::setMethod(QWebEngineHttpRequest::Method method)▲

Sets the method this WebEngine request is using to be method.

See Also▲

See also method()

void QWebEngineHttpRequest::setPostData(const QByteArray &postData)▲

Sets the (raw) POST data this WebEngine request contains to be postData.

See Also▲

See also postData()

void QWebEngineHttpRequest::setUrl(const QUrl &url)▲

Sets the URL this WebEngine request is referring to be url.

See Also▲

See also url()

void QWebEngineHttpRequest::swap(QWebEngineHttpRequest &other)▲

Swaps this WebEngine request with other. This function is very fast and never fails.

void QWebEngineHttpRequest::unsetHeader(const QByteArray &key)▲

Removes the header specified by key, if present.

See Also▲

See also setHeader(), header(), hasHeader(), headers()

QUrl QWebEngineHttpRequest::url() const▲

Returns the URL this WebEngine request is referring to.

See Also▲

See also setUrl()

bool QWebEngineHttpRequest::operator!=(const QWebEngineHttpRequest &other) const▲

Returns false if this object is not the same as other.

See Also▲

See also operator==()

QWebEngineHttpRequest &QWebEngineHttpRequest::operator=(const QWebEngineHttpRequest &other)▲

Creates a copy of other.

bool QWebEngineHttpRequest::operator==(const QWebEngineHttpRequest &other) const▲

Returns true if this object is the same as other (that is, if they have the same method, URL, and headers).

See Also▲

See also operator!=()

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+