Made the request stuff work.
This commit is contained in:
@@ -10,11 +10,21 @@
|
||||
#include "./socket.hpp"
|
||||
#include "./url.hpp"
|
||||
#include "../container/boxed_object.hpp"
|
||||
#include "../container/typeless_buffer.hpp"
|
||||
#include "../internal/common.hpp"
|
||||
#include "../io/stream.hpp"
|
||||
|
||||
namespace mijin
|
||||
{
|
||||
namespace http_method
|
||||
{
|
||||
inline constexpr std::string GET = "GET";
|
||||
inline constexpr std::string POST = "POST";
|
||||
inline constexpr std::string HEAD = "HEAD";
|
||||
inline constexpr std::string PUT = "PUT";
|
||||
inline constexpr std::string DELETE = "DELETE";
|
||||
}
|
||||
|
||||
struct HTTPVersion
|
||||
{
|
||||
unsigned major;
|
||||
@@ -30,13 +40,20 @@ struct HTTPRequest
|
||||
std::string body;
|
||||
};
|
||||
|
||||
struct HTTPRequestOptions
|
||||
{
|
||||
std::string method = "GET";
|
||||
std::multimap<std::string, std::string> headers;
|
||||
TypelessBuffer body;
|
||||
};
|
||||
|
||||
struct HTTPResponse
|
||||
{
|
||||
HTTPVersion version;
|
||||
unsigned status;
|
||||
std::string statusMessage;
|
||||
std::multimap<std::string, std::string> headers;
|
||||
std::string content;
|
||||
TypelessBuffer body;
|
||||
};
|
||||
|
||||
class HTTPStream
|
||||
|
||||
Reference in New Issue
Block a user