http: split structures into module http
This commit is contained in:
parent
03201fd28d
commit
d54bc367f1
3 changed files with 36 additions and 33 deletions
34
httpd.d
34
httpd.d
|
@ -1,5 +1,7 @@
|
|||
module httpd;
|
||||
|
||||
import http;
|
||||
|
||||
import std.algorithm;
|
||||
import std.array;
|
||||
import std.conv;
|
||||
|
@ -9,38 +11,6 @@ import std.socket;
|
|||
import std.stdio;
|
||||
import std.string;
|
||||
|
||||
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";
|
||||
}
|
||||
|
||||
class HttpdException : Exception
|
||||
{
|
||||
mixin basicExceptionCtors;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue