7#include <QtCore/QByteArray>
10namespace Sonde::Http {
24 QByteArray
header(
const char *name)
const {
return headers.value(QByteArray(name)); }
46ParseStatus parseRequest(QByteArray *buffer,
const ParseLimits &limits, Request *request,
50bool parseHead(
const QByteArray &head, Request *request);
55qsizetype decodeChunked(
const QByteArray &buffer, qsizetype from, qsizetype maxBody,
59QByteArray reasonPhrase(
int status);
65bool bearerTokenMatches(
const QByteArray &authorization,
const QByteArray &token);
ParseStatus
Result of trying to parse a request from the front of a buffer.
Definition httpparser_p.h:35
@ Incomplete
More data is needed.
Definition httpparser_p.h:36
@ Complete
A request was parsed and removed from the buffer.
Definition httpparser_p.h:37
Why something failed.
Definition expected.h:42
Size limits applied while parsing.
Definition httpparser_p.h:29
qsizetype maxBodyBytes
Decoded body (413 beyond).
Definition httpparser_p.h:31
qsizetype maxHeaderBytes
Request line and headers (431 beyond).
Definition httpparser_p.h:30
A parsed HTTP request.
Definition httpparser_p.h:14
QByteArray header(const char *name) const
A header value by lower-case name (empty if absent).
Definition httpparser_p.h:24
QHash< QByteArray, QByteArray > headers
Header fields; names lower-cased.
Definition httpparser_p.h:19
bool keepAlive
Whether the connection stays open after the response.
Definition httpparser_p.h:21
QByteArray method
Upper-cased method, e.g. "POST".
Definition httpparser_p.h:15
QByteArray body
Decoded body.
Definition httpparser_p.h:20
QByteArray target
Request target including any query string.
Definition httpparser_p.h:16
QByteArray path
Target without the query string.
Definition httpparser_p.h:17
QByteArray version
HTTP version, e.g. "HTTP/1.1".
Definition httpparser_p.h:18