2018-09-17 19:24:38 +02:00
|
|
|
#include "helloworldapplication.h"
|
|
|
|
|
|
2018-09-22 03:07:20 +02:00
|
|
|
#include "httprequest.h"
|
|
|
|
|
#include "httpresponse.h"
|
|
|
|
|
#include "httpclientconnection.h"
|
|
|
|
|
|
2018-09-17 19:24:38 +02:00
|
|
|
HelloWorldApplication::HelloWorldApplication(const QJsonObject &config, QObject *parent) :
|
|
|
|
|
WebApplication(parent)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void HelloWorldApplication::start()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
2018-09-22 03:07:20 +02:00
|
|
|
|
|
|
|
|
void HelloWorldApplication::handleRequest(HttpClientConnection *connection, const HttpRequest &request)
|
|
|
|
|
{
|
|
|
|
|
HttpResponse response;
|
|
|
|
|
response.protocol = request.protocol;
|
|
|
|
|
response.statusCode = HttpResponse::StatusCode::OK;
|
|
|
|
|
connection->sendResponse(response, "Hello from HelloWorldApplication: " + request.path);
|
|
|
|
|
}
|