mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 18:25:37 +08:00
refs #497, improved URL and network utils
* utility functions * URL, allow to switch to https * Adjusted database writer
This commit is contained in:
committed by
Mathew Sutcliffe
parent
03f4aa6889
commit
7cb4c6a6c6
@@ -16,8 +16,11 @@
|
||||
#include "blackmisc/network/server.h"
|
||||
#include "blackmisc/network/url.h"
|
||||
#include <QUrl>
|
||||
#include <QHttpPart>
|
||||
#include <QStringList>
|
||||
#include <QUrlQuery>
|
||||
#include <QNetworkRequest>
|
||||
#include <QJsonObject>
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
@@ -27,6 +30,15 @@ namespace BlackMisc
|
||||
class BLACKMISC_EXPORT CNetworkUtils
|
||||
{
|
||||
public:
|
||||
|
||||
//! Request type
|
||||
enum RequestType
|
||||
{
|
||||
Get,
|
||||
PostUrlEncoded,
|
||||
Multipart
|
||||
};
|
||||
|
||||
//! Is a connected interface available?
|
||||
//! \param withDebugOutput enables some debugging output
|
||||
//! \return
|
||||
@@ -74,6 +86,18 @@ namespace BlackMisc
|
||||
//! Ignore SSL verification such as self signed certificates
|
||||
static void ignoreSslVerification(QNetworkRequest &request);
|
||||
|
||||
//! Multipart with DEBUG FLAG for server
|
||||
static QHttpPart getMultipartWithDebugFlag();
|
||||
|
||||
//! Add debug flag
|
||||
static void addDebugFlag(QUrlQuery &qurl);
|
||||
|
||||
//! Multipart for JSON
|
||||
static QHttpPart getJsonTextMutlipart(const QJsonObject &json);
|
||||
|
||||
//! Our tweakes network request
|
||||
static QNetworkRequest getNetworkRequest(const CUrl &url, RequestType type = Get);
|
||||
|
||||
private:
|
||||
//! Deleted constructor
|
||||
CNetworkUtils() {}
|
||||
|
||||
Reference in New Issue
Block a user