summaryrefslogtreecommitdiff
path: root/includes/Http.h
blob: 05e72f4bae768f9abfa54b33f39eb47fd29ff971 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#pragma once

#include <map>
#include <BString.h>
#include <Handle.h>

namespace Balau {

namespace Http {

typedef std::map<String, String> StringMap;
typedef std::map<String, IO<Handle> > FileList;

class Request {
  public:
    int method;
    String host;
    String uri;
    StringMap variables;
    StringMap headers;
    FileList files;
    bool persistent;
};

enum {
    GET,
    HEAD,
    POST,
    PUT,
    DELETE,
    TRACE,
    OPTIONS,
    CONNECT,

    REDIRECT = 301,

    BAD_REQUEST = 400,
    UNAUTHORIZED = 401,
    FORBIDDEN = 403,
    NOT_FOUND = 404,

    ERROR = 500,
};

};

};