|
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) |
| 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. | |
| 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 | 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 104 of file QGCNetworkHelper.h.
| using QGCNetworkHelper::HttpStatusCode = typedef QHttpServerResponder::StatusCode |
HTTP status codes - uses Qt's QHttpServerResponder::StatusCode enum.
Definition at line 55 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 342 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 58 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 533 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 336 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 320 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(), and httpStatusText().
| void QGCNetworkHelper::configureProxy | ( | QNetworkAccessManager * | manager | ) |
Set up default proxy configuration on a network manager.
Definition at line 909 of file QGCNetworkHelper.cc.
References configureProxy().
Referenced by configureProxy(), 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 374 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 799 of file QGCNetworkHelper.cc.
References connectionType().
Referenced by connectionType().
| QString QGCNetworkHelper::connectionTypeName | ( | ConnectionType | type | ) |
Get human-readable name for connection type.
Definition at line 828 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 718 of file QGCNetworkHelper.cc.
References contentLength().
Referenced by contentLength().
| QString QGCNetworkHelper::contentType | ( | const QNetworkReply * | reply | ) |
Get Content-Type header from reply.
Definition at line 710 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 482 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 500 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 510 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 492 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 526 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 902 of file QGCNetworkHelper.cc.
References configureProxy(), and createNetworkManager().
Referenced by createNetworkManager(), and NTRIPSourceTableFetcher::NTRIPSourceTableFetcher().
| 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 424 of file QGCNetworkHelper.cc.
References configureRequest(), and createRequest().
Referenced by createRequest(), NTRIPSourceTableFetcher::fetch(), 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 519 of file QGCNetworkHelper.cc.
References createSslConfig().
Referenced by createSslConfig().
| QString QGCNetworkHelper::defaultUserAgent | ( | ) |
Get the default User-Agent string for QGC.
Definition at line 451 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 305 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 666 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 196 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 642 of file QGCNetworkHelper.cc.
References httpStatusCode().
Referenced by errorMessage(), httpStatusCode(), isRedirect(), and isSuccess().
| QString QGCNetworkHelper::httpStatusText | ( | HttpStatusCode | statusCode | ) |
Definition at line 48 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 183 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 851 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 866 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 897 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 793 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 84 of file QGCNetworkHelper.h.
|
inline |
Check if HTTP status indicates redirect (3xx)
Definition at line 78 of file QGCNetworkHelper.h.
Referenced by isRedirect().
|
inline |
Check if HTTP status indicates server error (5xx)
Definition at line 90 of file QGCNetworkHelper.h.
|
inline |
Check if HTTP status indicates success (2xx)
Definition at line 72 of file QGCNetworkHelper.h.
Referenced by isSuccess().
| bool QGCNetworkHelper::isHttpsUrl | ( | const QUrl & | url | ) |
Check if URL uses secure HTTPS scheme.
Definition at line 270 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 264 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 753 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 727 of file QGCNetworkHelper.cc.
References contentType(), and isJsonResponse().
Referenced by isJsonResponse().
| bool QGCNetworkHelper::isNetworkAvailable | ( | ) |
Check if network is available (not disconnected)
Definition at line 738 of file QGCNetworkHelper.cc.
References isNetworkAvailable().
Referenced by isNetworkAvailable().
| bool QGCNetworkHelper::isNetworkEthernet | ( | ) |
Check if current network connection is Ethernet.
Definition at line 775 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 700 of file QGCNetworkHelper.cc.
References httpStatusCode(), isHttpRedirect(), isRedirect(), and redirectUrl().
Referenced by isRedirect().
| bool QGCNetworkHelper::isSslAvailable | ( | ) |
Check if SSL is available.
Definition at line 883 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 686 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 253 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 538 of file QGCNetworkHelper.cc.
References loadCaCertificates().
Referenced by loadCaCertificates(), and LogRemoteSink::loadTlsCaCertificates().
| 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 547 of file QGCNetworkHelper.cc.
References loadClientCertAndKey().
Referenced by loadClientCertAndKey(), and LogRemoteSink::loadTlsClientCertificate().
| bool QGCNetworkHelper::looksLikeJson | ( | const QByteArray & | data | ) |
Check if data appears to be valid JSON (quick check)
| data | Data to check |
Definition at line 620 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 275 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 222 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 582 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 598 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 651 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 467 of file QGCNetworkHelper.cc.
References setBasicAuth().
Referenced by NTRIPSourceTableFetcher::fetch(), 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 472 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 477 of file QGCNetworkHelper.cc.
References setBearerToken().
Referenced by setBearerToken().
| void QGCNetworkHelper::setFormHeaders | ( | QNetworkRequest & | request | ) |
Set form data content headers.
Definition at line 446 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 440 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 431 of file QGCNetworkHelper.cc.
References defaultUserAgent(), and setStandardHeaders().
Referenced by setStandardHeaders().
| QString QGCNetworkHelper::sslVersion | ( | ) |
Get SSL library version string.
Definition at line 888 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 352 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 362 of file QGCNetworkHelper.cc.
References urlWithoutQuery().
Referenced by urlWithoutQuery().
|
inline |
Definition at line 44 of file QGCNetworkHelper.h.
|
inline |
Common MIME types for Content-Type headers.
Definition at line 43 of file QGCNetworkHelper.h.
|
inline |
Definition at line 46 of file QGCNetworkHelper.h.
|
inline |
Definition at line 45 of file QGCNetworkHelper.h.
Referenced by createFilePart().
|
inline |
Definition at line 48 of file QGCNetworkHelper.h.
|
inline |
Definition at line 47 of file QGCNetworkHelper.h.
|
constexpr |
Default connection timeout for initial connect.
Definition at line 33 of file QGCNetworkHelper.h.
|
constexpr |
Default request timeout in milliseconds.
Definition at line 30 of file QGCNetworkHelper.h.
|
constexpr |
Maximum number of redirects to follow.
Definition at line 36 of file QGCNetworkHelper.h.