cutelyst 4.3.0
A C++ Web Framework built on top of Qt, using the simple approach of Catalyst (Perl) framework.
useragent.h
1/*
2 * SPDX-FileCopyrightText: (C) 2019-2022 Daniel Nicoletti <dantti12@gmail.com>
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5#ifndef C_USERAGENT_H
6#define C_USERAGENT_H
7
8#include <Cutelyst/cutelyst_global.h>
9
10#include <QNetworkReply>
11
12class QIODevice;
13class QJsonArray;
14class QJsonObject;
15class QJsonDocument;
16class QHttpMultiPart;
17class QNetworkRequest;
19
20namespace Cutelyst {
21
22class Context;
23class Request;
24
42namespace UA {
43
47CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkAccessManager *networkAccessManager();
48
55CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply *head(const QNetworkRequest &request);
56
64CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply *get(const QNetworkRequest &request);
65
77CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply *post(const QNetworkRequest &request,
78 QIODevice *data);
79
85CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply *post(const QNetworkRequest &request,
86 const QByteArray &data);
87
103CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply *put(const QNetworkRequest &request,
104 QIODevice *data);
105
111CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply *put(const QNetworkRequest &request,
112 const QByteArray &data);
113
119CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply *deleteResource(const QNetworkRequest &request);
120
136CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply *sendCustomRequest(const QNetworkRequest &request,
137 const QByteArray &verb,
138 QIODevice *data = nullptr);
139
145CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply *sendCustomRequest(const QNetworkRequest &request,
146 const QByteArray &verb,
147 const QByteArray &data);
148
156CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply *post(const QNetworkRequest &request,
157 QHttpMultiPart *multiPart);
158
166CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply *put(const QNetworkRequest &request,
167 QHttpMultiPart *multiPart);
168
178CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply *sendCustomRequest(const QNetworkRequest &request,
179 const QByteArray &verb,
180 QHttpMultiPart *multiPart);
181
188CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply *postJson(const QNetworkRequest &request,
189 const QJsonDocument &doc);
190
197CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply *putJson(const QNetworkRequest &request,
198 const QJsonDocument &doc);
199
206CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply *
208 const QByteArray &verb,
209 const QJsonDocument &doc);
210
217CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply *postJsonObject(const QNetworkRequest &request,
218 const QJsonObject &object);
219
226CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply *putJsonObject(const QNetworkRequest &request,
227 const QJsonObject &object);
228
235CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply *
237 const QByteArray &verb,
238 const QJsonObject &object);
239
246CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply *postJsonArray(const QNetworkRequest &request,
247 const QJsonArray &array);
248
255CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply *putJsonArray(const QNetworkRequest &request,
256 const QJsonArray &array);
257
264CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply *
266 const QByteArray &verb,
267 const QJsonArray &array);
268
273CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply *forwardRequest(Request *request,
274 const QUrl &destination);
275
282CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply *forwardRequestResponse(Context *c,
283 const QUrl &destination);
284
289CUTELYST_PLUGIN_USERAGENT_EXPORT void forwardAsync(Context *c, const QUrl &destination);
290} // namespace UA
291
292} // namespace Cutelyst
293
294#endif // C_USERAGENT_H
The Cutelyst Context.
Definition context.h:42
A request.
Definition request.h:42
CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply * sendCustomRequestJsonObject(const QNetworkRequest &request, const QByteArray &verb, const QJsonObject &object)
CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply * putJson(const QNetworkRequest &request, const QJsonDocument &doc)
CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply * sendCustomRequest(const QNetworkRequest &request, const QByteArray &verb, QIODevice *data=nullptr)
Definition useragent.cpp:66
CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply * forwardRequestResponse(Context *c, const QUrl &destination)
CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply * postJsonArray(const QNetworkRequest &request, const QJsonArray &array)
CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply * head(const QNetworkRequest &request)
Definition useragent.cpp:30
CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply * get(const QNetworkRequest &request)
Definition useragent.cpp:35
CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply * forwardRequest(Request *request, const QUrl &destination)
CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply * postJsonObject(const QNetworkRequest &request, const QJsonObject &object)
CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply * putJsonArray(const QNetworkRequest &request, const QJsonArray &array)
CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkAccessManager * networkAccessManager()
Definition useragent.cpp:25
CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply * sendCustomRequestJson(const QNetworkRequest &request, const QByteArray &verb, const QJsonDocument &doc)
CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply * put(const QNetworkRequest &request, QIODevice *data)
Definition useragent.cpp:50
CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply * postJson(const QNetworkRequest &request, const QJsonDocument &doc)
Definition useragent.cpp:95
CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply * deleteResource(const QNetworkRequest &request)
Definition useragent.cpp:60
CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply * post(const QNetworkRequest &request, QIODevice *data)
Definition useragent.cpp:40
CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply * sendCustomRequestJsonArray(const QNetworkRequest &request, const QByteArray &verb, const QJsonArray &array)
CUTELYST_PLUGIN_USERAGENT_EXPORT QNetworkReply * putJsonObject(const QNetworkRequest &request, const QJsonObject &object)
CUTELYST_PLUGIN_USERAGENT_EXPORT void forwardAsync(Context *c, const QUrl &destination)
The Cutelyst namespace holds all public Cutelyst API.