QWebEngineHttpRequest Class
QWebEngineHttpRequest 클래스는 WebEngine 로 전송할 요청을 보관합니다. 더 보기...
헤더: | #include <QWebEngineHttpRequest> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS WebEngineCore) target_link_libraries(mytarget PRIVATE Qt6::WebEngineCore) |
qmake: | QT += webenginecore |
공용 타입
enum | Method { Get, Post } |
공용 함수
QWebEngineHttpRequest(const QUrl &url = QUrl(), const QWebEngineHttpRequest::Method &method = QWebEngineHttpRequest::Get) | |
QWebEngineHttpRequest(const QWebEngineHttpRequest &other) | |
~QWebEngineHttpRequest() | |
bool | hasHeader(const QByteArray &headerName) const |
QByteArray | header(const QByteArray &headerName) const |
QList<QByteArray> | headers() const |
QWebEngineHttpRequest::Method | method() const |
QByteArray | postData() const |
void | setHeader(const QByteArray &headerName, const QByteArray &headerValue) |
void | setMethod(QWebEngineHttpRequest::Method method) |
void | setPostData(const QByteArray &postData) |
void | setUrl(const QUrl &url) |
void | swap(QWebEngineHttpRequest &other) |
void | unsetHeader(const QByteArray &key) |
QUrl | url() const |
bool | operator!=(const QWebEngineHttpRequest &other) const |
QWebEngineHttpRequest & | operator=(const QWebEngineHttpRequest &other) |
bool | operator==(const QWebEngineHttpRequest &other) const |
정적 공용 멤버
QWebEngineHttpRequest | postRequest(const QUrl &url, const QMap<QString, QString> &postData) |
상세 설명
QWebEngineHttpRequest는 WebEngine 네트워킹 스택의 HTTP 요청을 나타냅니다. 네트워크를 통해 요청을 전송하는 데 필요한 정보를 보유합니다. 여기에는 URL과 요청을 수정하는 데 사용할 수 있는 몇 가지 보조 정보가 포함됩니다. QWebEnginePage::load ()와 QWebEngineView::load()는 모두 QWebEngineHttpRequest를 매개변수로 받습니다.
멤버 유형 문서
enum QWebEngineHttpRequest::Method
이 열거형 유형은 HTTP 요청을 전송하는 데 사용되는 메서드를 설명합니다:
상수 | 값 | 설명 |
---|---|---|
QWebEngineHttpRequest::Get | 0 | GET 메서드입니다. |
QWebEngineHttpRequest::Post | 1 | POST 메서드. |
멤버 함수 문서
[explicit]
QWebEngineHttpRequest::QWebEngineHttpRequest(const QUrl &url = QUrl(), const QWebEngineHttpRequest::Method &method = QWebEngineHttpRequest::Get)
요청할 URL을 url, 사용할 메서드를 method 로 지정하여 QWebEngineHttpRequest 객체를 생성합니다.
QWebEngineHttpRequest::QWebEngineHttpRequest(const QWebEngineHttpRequest &other)
other 의 복사본을 만듭니다.
[noexcept]
QWebEngineHttpRequest::~QWebEngineHttpRequest()
QWebEngineHttpRequest 개체를 폐기합니다.
bool QWebEngineHttpRequest::hasHeader(const QByteArray &headerName) const
이 WebEngine 요청에 headerName 헤더가 있는 경우 true
을 반환합니다.
setHeader(), header(), unsetHeader() 및 headers()도 참조하세요 .
QByteArray QWebEngineHttpRequest::header(const QByteArray &headerName) const
headerName 에 지정된 헤더를 반환합니다. 이러한 헤더가 없으면 빈 QByteArray 이 반환되며, 이는 존재하지만 콘텐츠가 없는 헤더와 구별할 수 없습니다( hasHeader()를 사용하여 헤더의 존재 여부를 확인합니다).
헤더는 setHeader()로 설정할 수 있습니다.
setHeader(), hasHeader(), unsetHeader() 및 headers()도 참조하세요 .
QList<QByteArray> QWebEngineHttpRequest::headers() const
이 WebEngine 요청에 설정된 모든 헤더의 목록을 반환합니다. 목록은 헤더가 설정된 순서대로 표시됩니다.
setHeader(), header(), hasHeader() 및 unsetHeader()도 참조하세요 .
QWebEngineHttpRequest::Method QWebEngineHttpRequest::method() const
이 WebEngine 요청이 사용하는 메서드를 반환합니다.
setMethod()도 참조하세요 .
QByteArray QWebEngineHttpRequest::postData() const
이 WebEngine 요청에 포함된 (원시) POST 데이터를 반환합니다.
setPostData()도 참조하세요 .
[static]
QWebEngineHttpRequest QWebEngineHttpRequest::postRequest(const QUrl &url, const QMap<QString, QString> &postData)
POST 메서드를 사용하는 QWebEngineHttpRequest ~ url 을 작성합니다.
참고: postData 에는 임의의 문자열이 포함될 수 있습니다. 이러한 문자열은 적절한 원시 데이터로 변환됩니다.
postData 및 setPostData()도 참조하세요 .
void QWebEngineHttpRequest::setHeader(const QByteArray &headerName, const QByteArray &headerValue)
headerName 헤더를 headerValue 값으로 설정합니다.
참고: 동일한 헤더를 두 번 설정하면 이전 설정이 재정의됩니다. 같은 이름의 여러 HTTP 헤더의 동작을 수행하려면 두 값을 쉼표(",")로 구분하여 연결하고 하나의 헤더를 설정해야 합니다.
header(), hasHeader(), unsetHeader() 및 headers()도 참조하세요 .
void QWebEngineHttpRequest::setMethod(QWebEngineHttpRequest::Method method)
이 WebEngine 요청이 사용하는 메서드를 method 으로 설정합니다.
method()도 참조하세요 .
void QWebEngineHttpRequest::setPostData(const QByteArray &postData)
이 WebEngine 요청에 포함된 (원시) POST 데이터를 postData 로 설정합니다.
postData()도 참조하세요 .
void QWebEngineHttpRequest::setUrl(const QUrl &url)
이 WebEngine 요청이 참조하는 URL을 url 으로 설정합니다.
url()도 참조하세요 .
[noexcept]
void QWebEngineHttpRequest::swap(QWebEngineHttpRequest &other)
이 WebEngine 요청을 other 으로 바꿉니다. 이 기능은 매우 빠르며 실패하지 않습니다.
void QWebEngineHttpRequest::unsetHeader(const QByteArray &key)
key 에 지정된 헤더(있는 경우)를 제거합니다.
setHeader(), header(), hasHeader() 및 headers()도 참조하세요 .
QUrl QWebEngineHttpRequest::url() const
이 WebEngine 요청이 참조하는 URL을 반환합니다.
setUrl()도 참조하세요 .
bool QWebEngineHttpRequest::operator!=(const QWebEngineHttpRequest &other) const
이 객체가 other 과 같지 않으면 false
을 반환합니다.
operator==()도 참조하세요 .
QWebEngineHttpRequest &QWebEngineHttpRequest::operator=(const QWebEngineHttpRequest &other)
other 의 복사본을 만듭니다.
bool QWebEngineHttpRequest::operator==(const QWebEngineHttpRequest &other) const
이 객체가 other 과 동일한 경우(즉, 메서드, URL 및 헤더가 동일한 경우) true
를 반환합니다.
operator!=()도 참조하세요 .
© 2025 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.