|
QGroundControl
Ground Control Station for MAVLink Drones
|
Classes | |
| struct | RequestConfig |
| Common request configuration options. More... | |
Typedefs | |
| using | HttpStatusCode = QHttpServerResponder::StatusCode |
| HTTP status codes - uses Qt's QHttpServerResponder::StatusCode enum. | |
| using | HttpMethod = QHttpServerRequest::Method |
| HTTP request methods - uses Qt's QHttpServerRequest::Method enum. | |
Enumerations | |
| enum class | HttpStatusClass { Informational , Success , Redirection , ClientError , ServerError , Unknown } |
| HTTP status code ranges. More... | |
| enum class | ConnectionType { None , Unknown , Ethernet , WiFi , Cellular , Bluetooth } |
| Network connection types. More... | |
Functions | |
| HttpStatusClass | classifyHttpStatus (int statusCode) |
| Classify an HTTP status code. | |
| QString | httpStatusText (HttpStatusCode statusCode) |
| QString | httpStatusText (int statusCode) |
| Get human-readable description for HTTP status code. | |
| QString | httpMethodName (HttpMethod method) |
| Get string name for an HTTP method (e.g., "GET", "POST") | |
| HttpMethod | parseHttpMethod (const QString &methodStr) |
| bool | isValidUrl (const QUrl &url) |
| bool | isHttpUrl (const QUrl &url) |
| Check if URL uses HTTP or HTTPS scheme. | |
| bool | isHttpsUrl (const QUrl &url) |
| Check if URL uses secure HTTPS scheme. | |
| QUrl | normalizeUrl (const QUrl &url) |
| Normalize URL (lowercase scheme/host, remove default ports, trailing slashes) | |
| QUrl | ensureScheme (const QUrl &url, const QString &defaultScheme=QStringLiteral("https")) |
| Ensure URL has scheme, defaulting to https:// if missing. | |
| QUrl | buildUrl (const QString &baseUrl, const QMap< QString, QString > ¶ms) |
| Build URL with query parameters from a map. | |
| QUrl | buildUrl (const QString &baseUrl, const QList< QPair< QString, QString > > ¶ms) |
| Build URL with query parameters from a list of pairs. | |
| QString | urlFileName (const QUrl &url) |
| Extract filename from URL path (last path segment) | |
| QUrl | urlWithoutQuery (const QUrl &url) |
| Get URL without query string and fragment. | |
| void | configureRequest (QNetworkRequest &request, const RequestConfig &config) |
| QNetworkRequest | createRequest (const QUrl &url, const RequestConfig &config) |
| void | setStandardHeaders (QNetworkRequest &request, const QString &userAgent={}) |
| Set standard browser-like headers on a request. | |
| void | setJsonHeaders (QNetworkRequest &request) |
| Set JSON content headers (Accept and Content-Type) | |
| void | setFormHeaders (QNetworkRequest &request) |
| Set form data content headers. | |
| QString | defaultUserAgent () |
| Get the default User-Agent string for QGC. | |
| void | setBasicAuth (QNetworkRequest &request, const QString &credentials) |
| void | setBasicAuth (QNetworkRequest &request, const QString &username, const QString &password) |
| void | setBearerToken (QNetworkRequest &request, const QString &token) |
| QString | createBasicAuthCredentials (const QString &username, const QString &password) |
| QHttpPart | createFormField (const QString &name, const QString &value) |
| QHttpPart | createFilePart (const QString &name, const QString &fileName, const QString &contentType, QIODevice *device) |
| QHttpPart | createFilePart (const QString &name, const QString &fileName, QIODevice *device) |
| QSslConfiguration | createSslConfig (QSsl::SslProtocol protocol) |
| QSslConfiguration | createInsecureSslConfig () |
| void | applySslConfig (QNetworkRequest &request, const QSslConfiguration &config) |
| QJsonDocument | parseJson (const QByteArray &data, QJsonParseError *error) |
| QJsonDocument | parseJsonReply (QNetworkReply *reply, QJsonParseError *error) |
| bool | looksLikeJson (const QByteArray &data) |
| int | httpStatusCode (const QNetworkReply *reply) |
| QUrl | redirectUrl (const QNetworkReply *reply) |
| QString | errorMessage (const QNetworkReply *reply) |
| bool | isSuccess (const QNetworkReply *reply) |
| Check if reply indicates success (no error and HTTP 2xx) | |
| bool | isRedirect (const QNetworkReply *reply) |
| Check if reply indicates a redirect. | |
| QString | contentType (const QNetworkReply *reply) |
| Get Content-Type header from reply. | |
| qint64 | contentLength (const QNetworkReply *reply) |
| Get Content-Length header from reply (-1 if not present) | |
| bool | isJsonResponse (const QNetworkReply *reply) |
| Check if response is JSON based on Content-Type. | |
| bool | isNetworkAvailable () |
| Check if network is available (not disconnected) | |
| bool | isInternetAvailable () |
| Check if internet is reachable (online state, stricter than isNetworkAvailable) | |
| bool | isNetworkEthernet () |
| Check if current network connection is Ethernet. | |
| bool | isBluetoothAvailable () |
| Check if Bluetooth is available on this device. | |
| ConnectionType | connectionType () |
| Get current network connection type. | |
| QString | connectionTypeName (ConnectionType type) |
| Get human-readable name for connection type. | |
| void | ignoreSslErrors (QNetworkReply *reply) |
| void | ignoreSslErrorsIfNeeded (QNetworkReply *reply) |
| bool | isSslAvailable () |
| Check if SSL is available. | |
| QString | sslVersion () |
| Get SSL library version string. | |
| void | initializeProxySupport () |
| QNetworkAccessManager * | createNetworkManager (QObject *parent) |
| void | configureProxy (QNetworkAccessManager *manager) |
| Set up default proxy configuration on a network manager. | |
| bool | looksLikeCompressedData (const QByteArray &data) |
| QJsonDocument | parseCompressedJson (const QByteArray &data, QJsonParseError *error) |
| bool | isHttpSuccess (int statusCode) |
| Check if HTTP status indicates success (2xx) | |
| bool | isHttpRedirect (int statusCode) |
| Check if HTTP status indicates redirect (3xx) | |
| bool | isHttpClientError (int statusCode) |
| Check if HTTP status indicates client error (4xx) | |
| bool | isHttpServerError (int statusCode) |
| Check if HTTP status indicates server error (5xx) | |
Variables | |
| constexpr int | kDefaultTimeoutMs = 30000 |
| Default request timeout in milliseconds. | |
| constexpr int | kDefaultConnectTimeoutMs = 10000 |
| Default connection timeout for initial connect. | |
| constexpr int | kMaxRedirects = 10 |
| Maximum number of redirects to follow. | |
| const QString | kContentTypeJson = QStringLiteral("application/json") |
| Common MIME types for Content-Type headers. | |
| const QString | kContentTypeFormUrlencoded = QStringLiteral("application/x-www-form-urlencoded") |
| const QString | kContentTypeOctetStream = QStringLiteral("application/octet-stream") |
| const QString | kContentTypeMultipartForm = QStringLiteral("multipart/form-data") |
| const QString | kContentTypeXml = QStringLiteral("application/xml") |
| const QString | kContentTypeTextPlain = QStringLiteral("text/plain") |
Network utility functions for HTTP requests, URL handling, and connectivity All functions are stateless and thread-safe
| using QGCNetworkHelper::HttpMethod = typedef QHttpServerRequest::Method |
HTTP request methods - uses Qt's QHttpServerRequest::Method enum.
Definition at line 102 of file QGCNetworkHelper.h.
| using QGCNetworkHelper::HttpStatusCode = typedef QHttpServerResponder::StatusCode |
HTTP status codes - uses Qt's QHttpServerResponder::StatusCode enum.
Definition at line 53 of file QGCNetworkHelper.h.
|
strong |
Network connection types.
| Enumerator | |
|---|---|
| None | No network connection. |
| Unknown | Connection type unknown. |
| Ethernet | Wired ethernet. |
| WiFi | Wireless LAN. |
| Cellular | Mobile/cellular data. |
| Bluetooth | Bluetooth connection. |
Definition at line 322 of file QGCNetworkHelper.h.
|
strong |
HTTP status code ranges.
| Enumerator | |
|---|---|
| Informational | 1xx - Informational |
| Success | 2xx - Success |
| Redirection | 3xx - Redirection |
| ClientError | 4xx - Client errors |
| ServerError | 5xx - Server errors |
| Unknown | Not a valid HTTP status. |
Definition at line 56 of file QGCNetworkHelper.h.
| void QGCNetworkHelper::applySslConfig | ( | QNetworkRequest & | request, |
| const QSslConfiguration & | config | ||
| ) |
Apply SSL configuration to a request
| request | Request to modify |
| config | SSL configuration to apply |
Definition at line 532 of file QGCNetworkHelper.cc.
References applySslConfig().
Referenced by applySslConfig().
| QUrl QGCNetworkHelper::buildUrl | ( | const QString & | baseUrl, |
| const QList< QPair< QString, QString > > & | params | ||
| ) |
Build URL with query parameters from a list of pairs.
Definition at line 335 of file QGCNetworkHelper.cc.
References buildUrl().
| QUrl QGCNetworkHelper::buildUrl | ( | const QString & | baseUrl, |
| const QMap< QString, QString > & | params | ||
| ) |
Build URL with query parameters from a map.
Definition at line 319 of file QGCNetworkHelper.cc.
References buildUrl().
Referenced by buildUrl(), and buildUrl().
| HttpStatusClass QGCNetworkHelper::classifyHttpStatus | ( | int | statusCode | ) |
Classify an HTTP status code.
Definition at line 27 of file QGCNetworkHelper.cc.
References classifyHttpStatus().
Referenced by classifyHttpStatus(), and httpStatusText().
| void QGCNetworkHelper::configureProxy | ( | QNetworkAccessManager * | manager | ) |
Set up default proxy configuration on a network manager.
Definition at line 868 of file QGCNetworkHelper.cc.
References configureProxy().
Referenced by configureProxy(), createNetworkManager(), TerrainOnlineQuery::TerrainOnlineQuery(), and TerrainTileManager::TerrainTileManager().
| void QGCNetworkHelper::configureRequest | ( | QNetworkRequest & | request, |
| const RequestConfig & | config = {} |
||
| ) |
Configure a QNetworkRequest with standard settings
| request | Request to configure |
| config | Configuration options (uses defaults if not specified) |
Definition at line 373 of file QGCNetworkHelper.cc.
References QGCNetworkHelper::RequestConfig::accept, QGCNetworkHelper::RequestConfig::acceptEncoding, QGCNetworkHelper::RequestConfig::allowRedirects, QGCNetworkHelper::RequestConfig::backgroundRequest, QGCNetworkHelper::RequestConfig::cacheEnabled, configureRequest(), QGCNetworkHelper::RequestConfig::contentType, defaultUserAgent(), QGCNetworkHelper::RequestConfig::http2Allowed, QGCNetworkHelper::RequestConfig::requestAttributes, QGCNetworkHelper::RequestConfig::timeoutMs, and QGCNetworkHelper::RequestConfig::userAgent.
Referenced by configureRequest(), and createRequest().
| ConnectionType QGCNetworkHelper::connectionType | ( | ) |
Get current network connection type.
Definition at line 758 of file QGCNetworkHelper.cc.
References connectionType().
Referenced by connectionType().
| QString QGCNetworkHelper::connectionTypeName | ( | ConnectionType | type | ) |
Get human-readable name for connection type.
Definition at line 787 of file QGCNetworkHelper.cc.
References connectionTypeName().
Referenced by connectionTypeName().
| qint64 QGCNetworkHelper::contentLength | ( | const QNetworkReply * | reply | ) |
Get Content-Length header from reply (-1 if not present)
Definition at line 677 of file QGCNetworkHelper.cc.
References contentLength().
Referenced by contentLength().
| QString QGCNetworkHelper::contentType | ( | const QNetworkReply * | reply | ) |
Get Content-Type header from reply.
Definition at line 669 of file QGCNetworkHelper.cc.
References contentType().
Referenced by contentType(), createFilePart(), and isJsonResponse().
| QString QGCNetworkHelper::createBasicAuthCredentials | ( | const QString & | username, |
| const QString & | password | ||
| ) |
Create Basic Auth credentials string from username and password
Definition at line 481 of file QGCNetworkHelper.cc.
References createBasicAuthCredentials().
Referenced by createBasicAuthCredentials(), and setBasicAuth().
| QHttpPart QGCNetworkHelper::createFilePart | ( | const QString & | name, |
| const QString & | fileName, | ||
| const QString & | contentType, | ||
| QIODevice * | device | ||
| ) |
Create a file upload part
| name | Field name (e.g., "filearg") |
| fileName | Display filename |
| contentType | MIME type of the file (e.g., "application/octet-stream") |
| device | IO device to read file data from (must stay valid during upload) |
Definition at line 499 of file QGCNetworkHelper.cc.
References contentType(), and createFilePart().
Referenced by createFilePart(), and createFilePart().
| QHttpPart QGCNetworkHelper::createFilePart | ( | const QString & | name, |
| const QString & | fileName, | ||
| QIODevice * | device | ||
| ) |
Create a file upload part with auto-detected content type
| name | Field name |
| fileName | Display filename (used for content-type detection) |
| device | IO device to read file data from |
Definition at line 509 of file QGCNetworkHelper.cc.
References createFilePart(), and kContentTypeOctetStream.
| QHttpPart QGCNetworkHelper::createFormField | ( | const QString & | name, |
| const QString & | value | ||
| ) |
Create a simple text form field part
| name | Field name |
| value | Field value |
Definition at line 491 of file QGCNetworkHelper.cc.
References createFormField().
Referenced by createFormField().
| QSslConfiguration QGCNetworkHelper::createInsecureSslConfig | ( | ) |
Create SSL configuration that disables peer verification (use with caution!) Only for development/testing or known self-signed certificates
Definition at line 525 of file QGCNetworkHelper.cc.
References createInsecureSslConfig().
Referenced by createInsecureSslConfig().
| QNetworkAccessManager * QGCNetworkHelper::createNetworkManager | ( | QObject * | parent = nullptr | ) |
Create a network access manager with recommended settings Caller takes ownership of the returned pointer
Definition at line 861 of file QGCNetworkHelper.cc.
References configureProxy(), and createNetworkManager().
Referenced by createNetworkManager().
| QNetworkRequest QGCNetworkHelper::createRequest | ( | const QUrl & | url, |
| const RequestConfig & | config = {} |
||
| ) |
Create a pre-configured QNetworkRequest
| url | The URL for the request |
| config | Configuration options (uses defaults if not specified) |
Definition at line 423 of file QGCNetworkHelper.cc.
References configureRequest(), and createRequest().
Referenced by createRequest(), and QGCFileDownload::start().
| QSslConfiguration QGCNetworkHelper::createSslConfig | ( | QSsl::SslProtocol | protocol = QSsl::TlsV1_2OrLater | ) |
Create SSL configuration with specified protocol
| protocol | TLS protocol version (default: TLS 1.2 or later) |
Definition at line 518 of file QGCNetworkHelper.cc.
References createSslConfig().
Referenced by createSslConfig().
| QString QGCNetworkHelper::defaultUserAgent | ( | ) |
Get the default User-Agent string for QGC.
Definition at line 450 of file QGCNetworkHelper.cc.
References defaultUserAgent().
Referenced by configureRequest(), defaultUserAgent(), and setStandardHeaders().
| QUrl QGCNetworkHelper::ensureScheme | ( | const QUrl & | url, |
| const QString & | defaultScheme | ||
| ) |
Ensure URL has scheme, defaulting to https:// if missing.
Definition at line 304 of file QGCNetworkHelper.cc.
References ensureScheme().
Referenced by ensureScheme().
| QString QGCNetworkHelper::errorMessage | ( | const QNetworkReply * | reply | ) |
Get error message from a network reply Combines network error and HTTP status into readable message
Definition at line 625 of file QGCNetworkHelper.cc.
References errorMessage(), httpStatusCode(), and httpStatusText().
Referenced by errorMessage().
| QString QGCNetworkHelper::httpMethodName | ( | HttpMethod | method | ) |
Get string name for an HTTP method (e.g., "GET", "POST")
Definition at line 195 of file QGCNetworkHelper.cc.
References httpMethodName().
Referenced by httpMethodName().
| int QGCNetworkHelper::httpStatusCode | ( | const QNetworkReply * | reply | ) |
Get HTTP status code from a network reply Returns -1 if not an HTTP response
Definition at line 601 of file QGCNetworkHelper.cc.
References httpStatusCode().
Referenced by errorMessage(), httpStatusCode(), isRedirect(), and isSuccess().
| QString QGCNetworkHelper::httpStatusText | ( | HttpStatusCode | statusCode | ) |
Definition at line 47 of file QGCNetworkHelper.cc.
References httpStatusText().
Referenced by errorMessage(), httpStatusText(), and httpStatusText().
| QString QGCNetworkHelper::httpStatusText | ( | int | statusCode | ) |
Get human-readable description for HTTP status code.
Definition at line 182 of file QGCNetworkHelper.cc.
References classifyHttpStatus(), and httpStatusText().
| void QGCNetworkHelper::ignoreSslErrors | ( | QNetworkReply * | reply | ) |
Configure SSL to ignore certificate errors (use with caution!) This should only be used for development/testing or known self-signed certs
Definition at line 810 of file QGCNetworkHelper.cc.
References error, and ignoreSslErrors().
Referenced by ignoreSslErrors().
| void QGCNetworkHelper::ignoreSslErrorsIfNeeded | ( | QNetworkReply * | reply | ) |
Ignore SSL errors if there's an OpenSSL version mismatch Qt may be built with OpenSSL 1.x but running with OpenSSL 3.x, causing certificate issues
Definition at line 825 of file QGCNetworkHelper.cc.
References ignoreSslErrorsIfNeeded().
Referenced by ignoreSslErrorsIfNeeded(), and QGCFileDownload::start().
| void QGCNetworkHelper::initializeProxySupport | ( | ) |
Initialize network proxy support (call once at application startup) Enables system proxy configuration for all network requests
Definition at line 856 of file QGCNetworkHelper.cc.
References initializeProxySupport().
Referenced by initializeProxySupport(), and QGCApplication::QGCApplication().
| bool QGCNetworkHelper::isBluetoothAvailable | ( | ) |
Check if Bluetooth is available on this device.
Definition at line 752 of file QGCNetworkHelper.cc.
References isBluetoothAvailable().
Referenced by isBluetoothAvailable().
|
inline |
Check if HTTP status indicates client error (4xx)
Definition at line 82 of file QGCNetworkHelper.h.
|
inline |
Check if HTTP status indicates redirect (3xx)
Definition at line 76 of file QGCNetworkHelper.h.
Referenced by isRedirect().
|
inline |
Check if HTTP status indicates server error (5xx)
Definition at line 88 of file QGCNetworkHelper.h.
|
inline |
Check if HTTP status indicates success (2xx)
Definition at line 70 of file QGCNetworkHelper.h.
Referenced by isSuccess().
| bool QGCNetworkHelper::isHttpsUrl | ( | const QUrl & | url | ) |
Check if URL uses secure HTTPS scheme.
Definition at line 269 of file QGCNetworkHelper.cc.
References isHttpsUrl().
Referenced by isHttpsUrl().
| bool QGCNetworkHelper::isHttpUrl | ( | const QUrl & | url | ) |
Check if URL uses HTTP or HTTPS scheme.
Definition at line 263 of file QGCNetworkHelper.cc.
References isHttpUrl().
Referenced by isHttpUrl().
| bool QGCNetworkHelper::isInternetAvailable | ( | ) |
Check if internet is reachable (online state, stricter than isNetworkAvailable)
Definition at line 712 of file QGCNetworkHelper.cc.
References isInternetAvailable().
Referenced by isInternetAvailable(), and QGeoTiledMappingManagerEngineQGC::QGeoTiledMappingManagerEngineQGC().
| bool QGCNetworkHelper::isJsonResponse | ( | const QNetworkReply * | reply | ) |
Check if response is JSON based on Content-Type.
Definition at line 686 of file QGCNetworkHelper.cc.
References contentType(), and isJsonResponse().
Referenced by isJsonResponse().
| bool QGCNetworkHelper::isNetworkAvailable | ( | ) |
Check if network is available (not disconnected)
Definition at line 697 of file QGCNetworkHelper.cc.
References isNetworkAvailable().
Referenced by isNetworkAvailable().
| bool QGCNetworkHelper::isNetworkEthernet | ( | ) |
Check if current network connection is Ethernet.
Definition at line 734 of file QGCNetworkHelper.cc.
References isNetworkEthernet().
Referenced by isNetworkEthernet(), TCPLink::isSecureConnection(), and UDPLink::isSecureConnection().
| bool QGCNetworkHelper::isRedirect | ( | const QNetworkReply * | reply | ) |
Check if reply indicates a redirect.
Definition at line 659 of file QGCNetworkHelper.cc.
References httpStatusCode(), isHttpRedirect(), isRedirect(), and redirectUrl().
Referenced by isRedirect().
| bool QGCNetworkHelper::isSslAvailable | ( | ) |
Check if SSL is available.
Definition at line 842 of file QGCNetworkHelper.cc.
References isSslAvailable().
Referenced by isSslAvailable().
| bool QGCNetworkHelper::isSuccess | ( | const QNetworkReply * | reply | ) |
Check if reply indicates success (no error and HTTP 2xx)
Definition at line 645 of file QGCNetworkHelper.cc.
References httpStatusCode(), isHttpSuccess(), and isSuccess().
Referenced by isSuccess().
| bool QGCNetworkHelper::isValidUrl | ( | const QUrl & | url | ) |
Check if URL is valid and has supported scheme Supported: http, https, file, qrc
Definition at line 252 of file QGCNetworkHelper.cc.
References isValidUrl().
Referenced by isValidUrl().
| bool QGCNetworkHelper::looksLikeCompressedData | ( | const QByteArray & | data | ) |
Check if data appears to be compressed based on magic bytes Detects: gzip, xz, zstd, bzip2, lz4
| data | Data to check (needs at least 4 bytes) |
Definition at line 885 of file QGCNetworkHelper.cc.
References QGCCompression::detectFormatFromData(), QGCCompression::isCompressionFormat(), and looksLikeCompressedData().
Referenced by looksLikeCompressedData(), and parseCompressedJson().
| bool QGCNetworkHelper::looksLikeJson | ( | const QByteArray & | data | ) |
Check if data appears to be valid JSON (quick check)
| data | Data to check |
Definition at line 579 of file QGCNetworkHelper.cc.
References looksLikeJson().
Referenced by looksLikeJson().
| QUrl QGCNetworkHelper::normalizeUrl | ( | const QUrl & | url | ) |
Normalize URL (lowercase scheme/host, remove default ports, trailing slashes)
Definition at line 274 of file QGCNetworkHelper.cc.
References normalizeUrl().
Referenced by normalizeUrl().
| QJsonDocument QGCNetworkHelper::parseCompressedJson | ( | const QByteArray & | data, |
| QJsonParseError * | error = nullptr |
||
| ) |
Parse JSON that may be compressed Automatically detects and decompresses gzip, xz, zstd, bzip2, lz4 data
| data | Raw data (compressed or uncompressed JSON) |
| error | Optional pointer to receive parse error details |
Definition at line 890 of file QGCNetworkHelper.cc.
References QGCCompression::decompressData(), error, looksLikeCompressedData(), and parseCompressedJson().
Referenced by TerrainTileCopernicus::getJsonFromData(), JsonParsing::isJsonFile(), JsonHelper::openInternalQGCJsonFile(), and parseCompressedJson().
| HttpMethod QGCNetworkHelper::parseHttpMethod | ( | const QString & | methodStr | ) |
Parse HTTP method from string (case-insensitive) Returns HttpMethod::Get if not recognized
Definition at line 221 of file QGCNetworkHelper.cc.
References parseHttpMethod().
Referenced by parseHttpMethod().
| QJsonDocument QGCNetworkHelper::parseJson | ( | const QByteArray & | data, |
| QJsonParseError * | error = nullptr |
||
| ) |
Parse JSON from network reply data
| data | Raw response data |
| error | Optional pointer to receive parse error details |
Definition at line 541 of file QGCNetworkHelper.cc.
References error, and parseJson().
Referenced by parseJson(), and parseJsonReply().
| QJsonDocument QGCNetworkHelper::parseJsonReply | ( | QNetworkReply * | reply, |
| QJsonParseError * | error = nullptr |
||
| ) |
Parse JSON from network reply
| reply | Network reply to read from |
| error | Optional pointer to receive parse error details |
Definition at line 557 of file QGCNetworkHelper.cc.
References error, parseJson(), and parseJsonReply().
Referenced by parseJsonReply().
| QUrl QGCNetworkHelper::redirectUrl | ( | const QNetworkReply * | reply | ) |
Get redirect URL from a reply, if any Returns empty URL if no redirect
Definition at line 610 of file QGCNetworkHelper.cc.
References redirectUrl().
Referenced by isRedirect(), and redirectUrl().
| void QGCNetworkHelper::setBasicAuth | ( | QNetworkRequest & | request, |
| const QString & | credentials | ||
| ) |
Set HTTP Basic Authentication header
| request | Request to modify |
| credentials | Base64-encoded "username:password" string |
Definition at line 466 of file QGCNetworkHelper.cc.
References setBasicAuth().
Referenced by setBasicAuth(), and setBasicAuth().
| void QGCNetworkHelper::setBasicAuth | ( | QNetworkRequest & | request, |
| const QString & | username, | ||
| const QString & | password | ||
| ) |
Set HTTP Basic Authentication header from username and password
| request | Request to modify |
| username | The username |
| password | The password |
Definition at line 471 of file QGCNetworkHelper.cc.
References createBasicAuthCredentials(), and setBasicAuth().
| void QGCNetworkHelper::setBearerToken | ( | QNetworkRequest & | request, |
| const QString & | token | ||
| ) |
Set Bearer token authentication header
| request | Request to modify |
| token | The bearer token (without "Bearer " prefix) |
Definition at line 476 of file QGCNetworkHelper.cc.
References setBearerToken().
Referenced by setBearerToken().
| void QGCNetworkHelper::setFormHeaders | ( | QNetworkRequest & | request | ) |
Set form data content headers.
Definition at line 445 of file QGCNetworkHelper.cc.
References setFormHeaders().
Referenced by setFormHeaders().
| void QGCNetworkHelper::setJsonHeaders | ( | QNetworkRequest & | request | ) |
Set JSON content headers (Accept and Content-Type)
Definition at line 439 of file QGCNetworkHelper.cc.
References setJsonHeaders().
Referenced by setJsonHeaders().
| void QGCNetworkHelper::setStandardHeaders | ( | QNetworkRequest & | request, |
| const QString & | userAgent | ||
| ) |
Set standard browser-like headers on a request.
Definition at line 430 of file QGCNetworkHelper.cc.
References defaultUserAgent(), and setStandardHeaders().
Referenced by setStandardHeaders().
| QString QGCNetworkHelper::sslVersion | ( | ) |
Get SSL library version string.
Definition at line 847 of file QGCNetworkHelper.cc.
References sslVersion().
Referenced by sslVersion().
| QString QGCNetworkHelper::urlFileName | ( | const QUrl & | url | ) |
Extract filename from URL path (last path segment)
Definition at line 351 of file QGCNetworkHelper.cc.
References urlFileName().
Referenced by urlFileName().
| QUrl QGCNetworkHelper::urlWithoutQuery | ( | const QUrl & | url | ) |
Get URL without query string and fragment.
Definition at line 361 of file QGCNetworkHelper.cc.
References urlWithoutQuery().
Referenced by urlWithoutQuery().
|
inline |
Definition at line 42 of file QGCNetworkHelper.h.
|
inline |
Common MIME types for Content-Type headers.
Definition at line 41 of file QGCNetworkHelper.h.
|
inline |
Definition at line 44 of file QGCNetworkHelper.h.
|
inline |
Definition at line 43 of file QGCNetworkHelper.h.
Referenced by createFilePart().
|
inline |
Definition at line 46 of file QGCNetworkHelper.h.
|
inline |
Definition at line 45 of file QGCNetworkHelper.h.
|
constexpr |
Default connection timeout for initial connect.
Definition at line 31 of file QGCNetworkHelper.h.
|
constexpr |
Default request timeout in milliseconds.
Definition at line 28 of file QGCNetworkHelper.h.
|
constexpr |
Maximum number of redirects to follow.
Definition at line 34 of file QGCNetworkHelper.h.