mirror of
https://github.com/MatsuriDayo/nekoray.git
synced 2025-12-18 04:54:38 +03:00
feat: inbound authorization
This commit is contained in:
31
main/HTTPRequestHelper.hpp
Normal file
31
main/HTTPRequestHelper.hpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#pragma once
|
||||
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QNetworkReply>
|
||||
#include <QNetworkRequest>
|
||||
#include <QObject>
|
||||
#include <functional>
|
||||
|
||||
namespace NekoRay::network {
|
||||
struct NekoHTTPResponse {
|
||||
QString error;
|
||||
QByteArray data;
|
||||
QList<QPair<QByteArray, QByteArray>> header;
|
||||
};
|
||||
|
||||
class NetworkRequestHelper : QObject {
|
||||
Q_OBJECT
|
||||
|
||||
explicit NetworkRequestHelper(QObject *parent) : QObject(parent){};
|
||||
|
||||
~NetworkRequestHelper() override = default;
|
||||
;
|
||||
|
||||
public:
|
||||
static NekoHTTPResponse HttpGet(const QUrl &url);
|
||||
|
||||
static QString GetHeader(const QList<QPair<QByteArray, QByteArray>> &header, const QString &name);
|
||||
};
|
||||
} // namespace NekoRay::network
|
||||
|
||||
using namespace NekoRay::network;
|
||||
Reference in New Issue
Block a user