mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:27:35 +00:00
ProtocolServer+LibWeb: Support more detailed HTTP requests
This patch adds the ability for ProtocolServer clients to specify which HTTP method to use, and also to include an optional HTTP request body.
This commit is contained in:
parent
cfafd4d52d
commit
2946a684ef
21 changed files with 78 additions and 26 deletions
|
@ -26,6 +26,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/ByteBuffer.h>
|
||||
#include <AK/Optional.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/URL.h>
|
||||
|
@ -60,6 +61,9 @@ public:
|
|||
Method method() const { return m_method; }
|
||||
void set_method(Method method) { m_method = method; }
|
||||
|
||||
const ByteBuffer& body() const { return m_body; }
|
||||
void set_body(const ByteBuffer& body) { m_body = body; }
|
||||
|
||||
String method_name() const;
|
||||
ByteBuffer to_raw_request() const;
|
||||
|
||||
|
@ -74,6 +78,7 @@ private:
|
|||
String m_resource;
|
||||
Method m_method { GET };
|
||||
Vector<Header> m_headers;
|
||||
ByteBuffer m_body;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue