|
QGroundControl
Ground Control Station for MAVLink Drones
|
#include <QtCore/QJsonDocument>#include <QtCore/QList>#include <QtCore/QPair>#include <QtCore/QString>#include <QtCore/QUrl>#include <QtCore/QVariant>#include <QtHttpServer/QHttpServerRequest>#include <QtHttpServer/QHttpServerResponder>#include <QtNetwork/QHttpPart>#include <QtNetwork/QNetworkReply>#include <QtNetwork/QNetworkRequest>#include <QtNetwork/QSslConfiguration>
Include dependency graph for QGCNetworkHelper.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Classes | |
| struct | QGCNetworkHelper::RequestConfig |
| Common request configuration options. More... | |
Namespaces | |
| namespace | QGCNetworkHelper |
Typedefs | |
| using | QGCNetworkHelper::HttpStatusCode = QHttpServerResponder::StatusCode |
| HTTP status codes - uses Qt's QHttpServerResponder::StatusCode enum. | |
| using | QGCNetworkHelper::HttpMethod = QHttpServerRequest::Method |
| HTTP request methods - uses Qt's QHttpServerRequest::Method enum. | |
Enumerations | |
| enum class | QGCNetworkHelper::HttpStatusClass { QGCNetworkHelper::Informational , QGCNetworkHelper::Success , QGCNetworkHelper::Redirection , QGCNetworkHelper::ClientError , QGCNetworkHelper::ServerError , QGCNetworkHelper::Unknown } |
| HTTP status code ranges. More... | |
| enum class | QGCNetworkHelper::ConnectionType { QGCNetworkHelper::None , QGCNetworkHelper::Unknown , QGCNetworkHelper::Ethernet , QGCNetworkHelper::WiFi , QGCNetworkHelper::Cellular , QGCNetworkHelper::Bluetooth } |
| Network connection types. More... | |
Functions | |
| HttpStatusClass | QGCNetworkHelper::classifyHttpStatus (int statusCode) |
| Classify an HTTP status code. | |
| bool | QGCNetworkHelper::isHttpSuccess (int statusCode) |
| Check if HTTP status indicates success (2xx) | |
| bool | QGCNetworkHelper::isHttpRedirect (int statusCode) |
| Check if HTTP status indicates redirect (3xx) | |
| bool | QGCNetworkHelper::isHttpClientError (int statusCode) |
| Check if HTTP status indicates client error (4xx) | |
| bool | QGCNetworkHelper::isHttpServerError (int statusCode) |
| Check if HTTP status indicates server error (5xx) | |
| QString | QGCNetworkHelper::httpStatusText (int statusCode) |
| Get human-readable description for HTTP status code. | |
| QString | QGCNetworkHelper::httpStatusText (HttpStatusCode statusCode) |
| QString | QGCNetworkHelper::httpMethodName (HttpMethod method) |
| Get string name for an HTTP method (e.g., "GET", "POST") | |
| HttpMethod | QGCNetworkHelper::parseHttpMethod (const QString &methodStr) |
| bool | QGCNetworkHelper::isValidUrl (const QUrl &url) |
| bool | QGCNetworkHelper::isHttpUrl (const QUrl &url) |
| Check if URL uses HTTP or HTTPS scheme. | |
| bool | QGCNetworkHelper::isHttpsUrl (const QUrl &url) |
| Check if URL uses secure HTTPS scheme. | |
| QUrl | QGCNetworkHelper::normalizeUrl (const QUrl &url) |
| Normalize URL (lowercase scheme/host, remove default ports, trailing slashes) | |
| QUrl | QGCNetworkHelper::ensureScheme (const QUrl &url, const QString &defaultScheme=QStringLiteral("https")) |
| Ensure URL has scheme, defaulting to https:// if missing. | |
| QUrl | QGCNetworkHelper::buildUrl (const QString &baseUrl, const QMap< QString, QString > ¶ms) |
| Build URL with query parameters from a map. | |
| QUrl | QGCNetworkHelper::buildUrl (const QString &baseUrl, const QList< QPair< QString, QString > > ¶ms) |
| Build URL with query parameters from a list of pairs. | |
| QString | QGCNetworkHelper::urlFileName (const QUrl &url) |
| Extract filename from URL path (last path segment) | |
| QUrl | QGCNetworkHelper::urlWithoutQuery (const QUrl &url) |
| Get URL without query string and fragment. | |
| void | QGCNetworkHelper::configureRequest (QNetworkRequest &request, const RequestConfig &config) |
| QNetworkRequest | QGCNetworkHelper::createRequest (const QUrl &url, const RequestConfig &config) |
| void | QGCNetworkHelper::setStandardHeaders (QNetworkRequest &request, const QString &userAgent={}) |
| Set standard browser-like headers on a request. | |
| void | QGCNetworkHelper::setJsonHeaders (QNetworkRequest &request) |
| Set JSON content headers (Accept and Content-Type) | |
| void | QGCNetworkHelper::setFormHeaders (QNetworkRequest &request) |
| Set form data content headers. | |
| QString | QGCNetworkHelper::defaultUserAgent () |
| Get the default User-Agent string for QGC. | |
| void | QGCNetworkHelper::setBasicAuth (QNetworkRequest &request, const QString &credentials) |
| void | QGCNetworkHelper::setBasicAuth (QNetworkRequest &request, const QString &username, const QString &password) |
| void | QGCNetworkHelper::setBearerToken (QNetworkRequest &request, const QString &token) |
| QString | QGCNetworkHelper::createBasicAuthCredentials (const QString &username, const QString &password) |
| QHttpPart | QGCNetworkHelper::createFormField (const QString &name, const QString &value) |
| QHttpPart | QGCNetworkHelper::createFilePart (const QString &name, const QString &fileName, const QString &contentType, QIODevice *device) |
| QHttpPart | QGCNetworkHelper::createFilePart (const QString &name, const QString &fileName, QIODevice *device) |
| QSslConfiguration | QGCNetworkHelper::createSslConfig (QSsl::SslProtocol protocol) |
| QSslConfiguration | QGCNetworkHelper::createInsecureSslConfig () |
| void | QGCNetworkHelper::applySslConfig (QNetworkRequest &request, const QSslConfiguration &config) |
| QJsonDocument | QGCNetworkHelper::parseJson (const QByteArray &data, QJsonParseError *error) |
| QJsonDocument | QGCNetworkHelper::parseJsonReply (QNetworkReply *reply, QJsonParseError *error) |
| bool | QGCNetworkHelper::looksLikeJson (const QByteArray &data) |
| int | QGCNetworkHelper::httpStatusCode (const QNetworkReply *reply) |
| QUrl | QGCNetworkHelper::redirectUrl (const QNetworkReply *reply) |
| QString | QGCNetworkHelper::errorMessage (const QNetworkReply *reply) |
| bool | QGCNetworkHelper::isSuccess (const QNetworkReply *reply) |
| Check if reply indicates success (no error and HTTP 2xx) | |
| bool | QGCNetworkHelper::isRedirect (const QNetworkReply *reply) |
| Check if reply indicates a redirect. | |
| QString | QGCNetworkHelper::contentType (const QNetworkReply *reply) |
| Get Content-Type header from reply. | |
| qint64 | QGCNetworkHelper::contentLength (const QNetworkReply *reply) |
| Get Content-Length header from reply (-1 if not present) | |
| bool | QGCNetworkHelper::isJsonResponse (const QNetworkReply *reply) |
| Check if response is JSON based on Content-Type. | |
| bool | QGCNetworkHelper::isNetworkAvailable () |
| Check if network is available (not disconnected) | |
| bool | QGCNetworkHelper::isInternetAvailable () |
| Check if internet is reachable (online state, stricter than isNetworkAvailable) | |
| bool | QGCNetworkHelper::isNetworkEthernet () |
| Check if current network connection is Ethernet. | |
| bool | QGCNetworkHelper::isBluetoothAvailable () |
| Check if Bluetooth is available on this device. | |
| ConnectionType | QGCNetworkHelper::connectionType () |
| Get current network connection type. | |
| QString | QGCNetworkHelper::connectionTypeName (ConnectionType type) |
| Get human-readable name for connection type. | |
| void | QGCNetworkHelper::ignoreSslErrors (QNetworkReply *reply) |
| void | QGCNetworkHelper::ignoreSslErrorsIfNeeded (QNetworkReply *reply) |
| bool | QGCNetworkHelper::isSslAvailable () |
| Check if SSL is available. | |
| QString | QGCNetworkHelper::sslVersion () |
| Get SSL library version string. | |
| void | QGCNetworkHelper::initializeProxySupport () |
| QNetworkAccessManager * | QGCNetworkHelper::createNetworkManager (QObject *parent) |
| void | QGCNetworkHelper::configureProxy (QNetworkAccessManager *manager) |
| Set up default proxy configuration on a network manager. | |
| bool | QGCNetworkHelper::looksLikeCompressedData (const QByteArray &data) |
| QJsonDocument | QGCNetworkHelper::parseCompressedJson (const QByteArray &data, QJsonParseError *error) |
Variables | |
| constexpr int | QGCNetworkHelper::kDefaultTimeoutMs = 30000 |
| Default request timeout in milliseconds. | |
| constexpr int | QGCNetworkHelper::kDefaultConnectTimeoutMs = 10000 |
| Default connection timeout for initial connect. | |
| constexpr int | QGCNetworkHelper::kMaxRedirects = 10 |
| Maximum number of redirects to follow. | |
| const QString | QGCNetworkHelper::kContentTypeJson = QStringLiteral("application/json") |
| Common MIME types for Content-Type headers. | |
| const QString | QGCNetworkHelper::kContentTypeFormUrlencoded = QStringLiteral("application/x-www-form-urlencoded") |
| const QString | QGCNetworkHelper::kContentTypeOctetStream = QStringLiteral("application/octet-stream") |
| const QString | QGCNetworkHelper::kContentTypeMultipartForm = QStringLiteral("multipart/form-data") |
| const QString | QGCNetworkHelper::kContentTypeXml = QStringLiteral("application/xml") |
| const QString | QGCNetworkHelper::kContentTypeTextPlain = QStringLiteral("text/plain") |