http: split structures into module http

This commit is contained in:
Jeremy Baxter 2024-08-07 13:24:59 +12:00
parent 03201fd28d
commit d54bc367f1
3 changed files with 36 additions and 33 deletions

33
http.d Normal file
View file

@ -0,0 +1,33 @@
module http;
enum HTTPMethod
{
GET,
HEAD,
POST,
PUT,
DELETE,
CONNECT,
OPTIONS,
TRACE,
invalid
}
struct HTTPRequest
{
HTTPMethod method;
string resource;
string[string] parameters;
string[string] headers;
string httpVersion = "HTTP/1.1";
alias path = resource;
}
struct HTTPResponse
{
string status;
string[string] headers;
string responseBody;
string httpVersion = "HTTP/1.1";
}