Implemented basic example response
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
#include "seriesapplication.h"
|
||||
|
||||
#include "httprequest.h"
|
||||
#include "httpresponse.h"
|
||||
#include "httpclientconnection.h"
|
||||
|
||||
SeriesApplication::SeriesApplication(const QJsonObject &config, QObject *parent) :
|
||||
WebApplication(parent)
|
||||
{
|
||||
@@ -10,3 +14,11 @@ void SeriesApplication::start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void SeriesApplication::handleRequest(HttpClientConnection *connection, const HttpRequest &request)
|
||||
{
|
||||
HttpResponse response;
|
||||
response.protocol = request.protocol;
|
||||
response.statusCode = HttpResponse::StatusCode::OK;
|
||||
connection->sendResponse(response, "Hello from SeriesApplication: " + request.path);
|
||||
}
|
||||
|
@@ -12,4 +12,6 @@ public:
|
||||
SeriesApplication(const QJsonObject &config, QObject *parent = Q_NULLPTR);
|
||||
|
||||
void start() Q_DECL_OVERRIDE;
|
||||
|
||||
void handleRequest(HttpClientConnection *connection, const HttpRequest &request) Q_DECL_OVERRIDE;
|
||||
};
|
||||
|
Reference in New Issue
Block a user