|
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 | |
| 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) |
| Base64-encoded UTF-8 username:password, without the authentication scheme. | |
| QString | defaultUserAgent () |
| "<application>/<version> (Qt <version>)". | |
| QSslConfiguration | createSslConfig () |
| The default TLS configuration restricted to TLS 1.2 or later. | |
| QNetworkAccessManager * | createNetworkManager (QObject *parent) |
| void | configureProxy (QNetworkAccessManager *manager) |
| Set up default proxy configuration on a network manager. | |
| 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. | |
| QUrl | urlWithoutQuery (const QUrl &url) |
| Get URL without query string and fragment. | |
| QString | redactedUrlForLogging (const QUrl &url) |
| QString | redactedUrlForLogging (const QString &url) |
| 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. | |
| 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 | createInsecureSslConfig () |
| void | applySslConfig (QNetworkRequest &request, const QSslConfiguration &config) |
| QList< QSslCertificate > | loadCaCertificates (const QString &filePath, QString *errorOut) |
| bool | loadClientCertAndKey (const QString &certPath, const QString &keyPath, QSslCertificate &certOut, QSslKey &keyOut, QString *errorOut) |
| 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. | |
| QNetworkInformation * | networkInformation () |
| The platform's network information, preferring a backend that reports reachability; null without a backend. | |
| bool | isNetworkAvailable () |
| Check if network is available (not disconnected); assumed available without a backend. | |
| 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 () |
| 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 107 of file QGCNetworkHelper.h.
| using QGCNetworkHelper::HttpStatusCode = typedef QHttpServerResponder::StatusCode |
HTTP status codes - uses Qt's QHttpServerResponder::StatusCode enum.
Definition at line 58 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 346 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 61 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 610 of file QGCNetworkHelper.cc.
References applySslConfig(), and config.
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 323 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 307 of file QGCNetworkHelper.cc.
References buildUrl().
Referenced by buildUrl(), and buildUrl().
| HttpStatusClass QGCNetworkHelper::classifyHttpStatus | ( | int | statusCode | ) |
Classify an HTTP status code.
Definition at line 28 of file QGCNetworkHelper.cc.
References classifyHttpStatus().
Referenced by classifyHttpStatus().
| void QGCNetworkHelper::configureProxy | ( | QNetworkAccessManager * | manager | ) |
Set up default proxy configuration on a network manager.
Definition at line 57 of file QGCNetworkClient.cc.
Referenced by createNetworkManager(), MAVLinkLogManager::MAVLinkLogManager(), 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 479 of file QGCNetworkHelper.cc.
References config, configureRequest(), and defaultUserAgent().
Referenced by configureRequest(), and createRequest().
| ConnectionType QGCNetworkHelper::connectionType | ( | ) |
Get current network connection type.
Definition at line 852 of file QGCNetworkHelper.cc.
References connectionType(), and networkInformation().
Referenced by connectionType().
| QString QGCNetworkHelper::connectionTypeName | ( | ConnectionType | type | ) |
Get human-readable name for connection type.
Definition at line 877 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 797 of file QGCNetworkHelper.cc.
References contentLength().
Referenced by contentLength().
| QString QGCNetworkHelper::contentType | ( | const QNetworkReply * | reply | ) |
Get Content-Type header from reply.
Definition at line 789 of file QGCNetworkHelper.cc.
References contentType().
Referenced by contentType(), createFilePart(), and isJsonResponse().
| QString QGCNetworkHelper::createBasicAuthCredentials | ( | const QString & | username, |
| const QString & | password | ||
| ) |
Base64-encoded UTF-8 username:password, without the authentication scheme.
Create Basic Auth credentials string from username and password
Definition at line 29 of file QGCNetworkClient.cc.
Referenced by NTRIPHttpRequest::build(), 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 584 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 594 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 576 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 603 of file QGCNetworkHelper.cc.
References config, and createInsecureSslConfig().
Referenced by createInsecureSslConfig().
| QNetworkAccessManager * QGCNetworkHelper::createNetworkManager | ( | QObject * | parent | ) |
Create a network access manager with recommended settings Caller takes ownership of the returned pointer
Definition at line 50 of file QGCNetworkClient.cc.
References configureProxy().
| 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 540 of file QGCNetworkHelper.cc.
References config, configureRequest(), and createRequest().
Referenced by createRequest(), and QGCFileDownload::start().
| QSslConfiguration QGCNetworkHelper::createSslConfig | ( | ) |
The default TLS configuration restricted to TLS 1.2 or later.
Definition at line 43 of file QGCNetworkClient.cc.
References config.
Referenced by NTRIPHttpSession::open().
| QString QGCNetworkHelper::defaultUserAgent | ( | ) |
"<application>/<version> (Qt <version>)".
Definition at line 35 of file QGCNetworkClient.cc.
Referenced by NTRIPHttpRequest::build(), configureRequest(), and setStandardHeaders().
| QUrl QGCNetworkHelper::ensureScheme | ( | const QUrl & | url, |
| const QString & | defaultScheme | ||
| ) |
Ensure URL has scheme, defaulting to https:// if missing.
Definition at line 292 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 745 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 193 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 721 of file QGCNetworkHelper.cc.
References httpStatusCode().
Referenced by errorMessage(), httpStatusCode(), isRedirect(), and isSuccess().
| QString QGCNetworkHelper::httpStatusText | ( | HttpStatusCode | statusCode | ) |
Definition at line 49 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 184 of file QGCNetworkHelper.cc.
References 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 900 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 915 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 946 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 846 of file QGCNetworkHelper.cc.
References isBluetoothAvailable().
Referenced by BluetoothConfiguration::isBluetoothAvailable(), LinkManager::isBluetoothAvailable(), and isBluetoothAvailable().
|
inline |
Check if HTTP status indicates client error (4xx)
Definition at line 87 of file QGCNetworkHelper.h.
|
inline |
Check if HTTP status indicates redirect (3xx)
Definition at line 81 of file QGCNetworkHelper.h.
Referenced by isRedirect().
|
inline |
Check if HTTP status indicates server error (5xx)
Definition at line 93 of file QGCNetworkHelper.h.
|
inline |
Check if HTTP status indicates success (2xx)
Definition at line 75 of file QGCNetworkHelper.h.
Referenced by isSuccess().
| bool QGCNetworkHelper::isHttpsUrl | ( | const QUrl & | url | ) |
Check if URL uses secure HTTPS scheme.
Definition at line 267 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 261 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 834 of file QGCNetworkHelper.cc.
References isInternetAvailable(), and networkInformation().
Referenced by isInternetAvailable(), and QGeoTiledMappingManagerEngineQGC::QGeoTiledMappingManagerEngineQGC().
| bool QGCNetworkHelper::isJsonResponse | ( | const QNetworkReply * | reply | ) |
Check if response is JSON based on Content-Type.
Definition at line 806 of file QGCNetworkHelper.cc.
References contentType(), and isJsonResponse().
Referenced by isJsonResponse().
| bool QGCNetworkHelper::isNetworkAvailable | ( | ) |
Check if network is available (not disconnected); assumed available without a backend.
Definition at line 828 of file QGCNetworkHelper.cc.
References isNetworkAvailable(), and networkInformation().
Referenced by isNetworkAvailable(), and QGCNetworkAvailabilityMonitor::QGCNetworkAvailabilityMonitor().
| bool QGCNetworkHelper::isNetworkEthernet | ( | ) |
Check if current network connection is Ethernet.
Definition at line 840 of file QGCNetworkHelper.cc.
References isNetworkEthernet(), and networkInformation().
Referenced by isNetworkEthernet(), TCPLink::isSecureConnection(), and UDPLink::isSecureConnection().
| bool QGCNetworkHelper::isRedirect | ( | const QNetworkReply * | reply | ) |
Check if reply indicates a redirect.
Definition at line 779 of file QGCNetworkHelper.cc.
References httpStatusCode(), isHttpRedirect(), isRedirect(), and redirectUrl().
Referenced by isRedirect().
| bool QGCNetworkHelper::isSslAvailable | ( | ) |
Check if SSL is available.
Definition at line 932 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 765 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 250 of file QGCNetworkHelper.cc.
References isValidUrl().
Referenced by isValidUrl().
| QList< QSslCertificate > QGCNetworkHelper::loadCaCertificates | ( | const QString & | filePath, |
| QString * | errorOut = nullptr |
||
| ) |
Load CA certificates from a PEM file
| filePath | Path to PEM file containing one or more certificates |
| errorOut | Optional pointer to receive error message |
Definition at line 615 of file QGCNetworkHelper.cc.
References loadCaCertificates().
Referenced by loadCaCertificates().
| bool QGCNetworkHelper::loadClientCertAndKey | ( | const QString & | certPath, |
| const QString & | keyPath, | ||
| QSslCertificate & | certOut, | ||
| QSslKey & | keyOut, | ||
| QString * | errorOut = nullptr |
||
| ) |
Load a client certificate and private key from PEM files Tries RSA first, then EC for the key format
| certPath | Path to PEM file containing the client certificate |
| keyPath | Path to PEM file containing the private key |
| certOut | Receives the loaded certificate |
| keyOut | Receives the loaded key |
| errorOut | Optional pointer to receive error message |
Definition at line 624 of file QGCNetworkHelper.cc.
References loadClientCertAndKey().
Referenced by loadClientCertAndKey().
| bool QGCNetworkHelper::looksLikeJson | ( | const QByteArray & | data | ) |
Check if data appears to be valid JSON (quick check)
| data | Data to check |
Definition at line 699 of file QGCNetworkHelper.cc.
References looksLikeJson().
Referenced by looksLikeJson().
| QNetworkInformation * QGCNetworkHelper::networkInformation | ( | ) |
The platform's network information, preferring a backend that reports reachability; null without a backend.
Definition at line 817 of file QGCNetworkHelper.cc.
References networkInformation().
Referenced by connectionType(), isInternetAvailable(), isNetworkAvailable(), isNetworkEthernet(), networkInformation(), and QGCNetworkAvailabilityMonitor::QGCNetworkAvailabilityMonitor().
| QUrl QGCNetworkHelper::normalizeUrl | ( | const QUrl & | url | ) |
Normalize URL (lowercase scheme/host, remove default ports, trailing slashes)
Definition at line 272 of file QGCNetworkHelper.cc.
References normalizeUrl().
Referenced by normalizeUrl().
| HttpMethod QGCNetworkHelper::parseHttpMethod | ( | const QString & | methodStr | ) |
Parse HTTP method from string (case-insensitive) Returns HttpMethod::Get if not recognized
Definition at line 219 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 661 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 677 of file QGCNetworkHelper.cc.
References error, parseJson(), and parseJsonReply().
Referenced by parseJsonReply().
| QString QGCNetworkHelper::redactedUrlForLogging | ( | const QString & | url | ) |
Definition at line 459 of file QGCNetworkHelper.cc.
References redactedUrlForLogging().
| QString QGCNetworkHelper::redactedUrlForLogging | ( | const QUrl & | url | ) |
Return a URL suitable for diagnostics. Stream identity is preserved while user info, query values, and fragment content are redacted.
Definition at line 421 of file QGCNetworkHelper.cc.
References redactedUrlForLogging().
Referenced by GStreamer::SourceFactory::create(), redactedUrlForLogging(), redactedUrlForLogging(), VehicleCameraControl::setCurrentStream(), and VideoSettings::streamConfigured().
| QUrl QGCNetworkHelper::redirectUrl | ( | const QNetworkReply * | reply | ) |
Get redirect URL from a reply, if any Returns empty URL if no redirect
Definition at line 730 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 10 of file QGCNetworkClient.cc.
Referenced by 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 17 of file QGCNetworkClient.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 22 of file QGCNetworkClient.cc.
| void QGCNetworkHelper::setFormHeaders | ( | QNetworkRequest & | request | ) |
Set form data content headers.
Definition at line 567 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 558 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 547 of file QGCNetworkHelper.cc.
References defaultUserAgent(), and setStandardHeaders().
Referenced by setStandardHeaders().
| QString QGCNetworkHelper::sslVersion | ( | ) |
Get SSL library version string.
Definition at line 937 of file QGCNetworkHelper.cc.
References sslVersion().
Referenced by sslVersion().
| QUrl QGCNetworkHelper::urlWithoutQuery | ( | const QUrl & | url | ) |
Get URL without query string and fragment.
Definition at line 339 of file QGCNetworkHelper.cc.
References urlWithoutQuery().
Referenced by urlWithoutQuery().
|
inline |
Definition at line 47 of file QGCNetworkHelper.h.
|
inline |
Common MIME types for Content-Type headers.
Definition at line 46 of file QGCNetworkHelper.h.
|
inline |
Definition at line 49 of file QGCNetworkHelper.h.
|
inline |
Definition at line 48 of file QGCNetworkHelper.h.
Referenced by createFilePart().
|
inline |
Definition at line 51 of file QGCNetworkHelper.h.
|
inline |
Definition at line 50 of file QGCNetworkHelper.h.
|
constexpr |
Default connection timeout for initial connect.
Definition at line 36 of file QGCNetworkHelper.h.
|
constexpr |
Default request timeout in milliseconds.
Definition at line 33 of file QGCNetworkHelper.h.
|
constexpr |
Maximum number of redirects to follow.
Definition at line 39 of file QGCNetworkHelper.h.