Files
tactility/Tactility/Include/Tactility/network/HttpServerReq.h
T
Ken Van Hoeylandt 1b16184a72 Multi-platform http server (#646)
- Add server support to `http-module`
- Ensure `DevelopmentService` works on all platforms (including posix)
- Ensure the built-in web server with dashboard works on all platforms (inluding posix). It still has some issues with certain featuers, but the basics work.
2026-09-06 14:16:23 +02:00

25 lines
909 B
C++

#pragma once
#include <http/server.h>
#include <string>
// Helper functions for HttpServerRequest from http-module
namespace tt::network {
bool getHeaderOrSendError(struct HttpServerRequest* request, const std::string& name, std::string& value);
bool getMultiPartBoundaryOrSendError(struct HttpServerRequest* request, std::string& boundary);
bool getQueryOrSendError(struct HttpServerRequest* request, std::string& query);
/** @return the received text up to and including @a terminator, or "" if the connection failed
* or the preamble exceeded its bounded maximum length without finding @a terminator. */
std::string receiveTextUntil(struct HttpServerRequest* request, const std::string& terminator);
bool readAndDiscardOrSendError(struct HttpServerRequest* request, const std::string& toRead);
size_t receiveFile(struct HttpServerRequest* request, size_t length, const std::string& filePath);
}