libhttppp ..
Loading...
Searching...
No Matches
httpdefinitions.h
1/*******************************************************************************
2Copyright (c) 2014, Jan Koester jan.koester@gmx.net
3All rights reserved.
4
5Redistribution and use in source and binary forms, with or without
6modification, are permitted provided that the following conditions are met:
7 * Redistributions of source code must retain the above copyright
8 notice, this list of conditions and the following disclaimer.
9 * Redistributions in binary form must reproduce the above copyright
10 notice, this list of conditions and the following disclaimer in the
11 documentation and/or other materials provided with the distribution.
12 * Neither the name of the <organization> nor the
13 names of its contributors may be used to endorse or promote products
14 derived from this software without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
20DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*******************************************************************************/
27
28#pragma once
29
30//define REQUEST TYPE
31#define PARSEREQUEST 0
32#define GETREQUEST 1
33#define POSTREQUEST 2
34#define DELETEREQUEST 3
35#define PUTREQUEST 4
36
37//define http version
38
39#define HTTPVERSION(V) ("HTTP/"#V)
40
41//#define HTTPCODE(C,N) ("HTTP/1.0 " #C " " #N "\r\n")
42#define HTTPSTATECODE(C,N) (#C " " #N)
43
44/*HTTP 1xx states*/
45#define HTTP100 HTTPSTATECODE(100,Continue)
46#define HTTP101 HTTPSTATECODE(101,Switching Protocols)
47#define HTTP102 HTTPSTATECODE(102,Processing)
48#define HTTP118 HTTPSTATECODE(118,Connection timed out)
49
50/*HTTP 2xx states*/
51#define HTTP200 HTTPSTATECODE(200,OK)
52#define HTTP201 HTTPSTATECODE(201,Created)
53#define HTTP202 HTTPSTATECODE(202,Accepted)
54#define HTTP203 HTTPSTATECODE(203,Non-Authoritative Information)
55#define HTTP204 HTTPSTATECODE(204,No Content)
56#define HTTP205 HTTPSTATECODE(205,Reset Content)
57#define HTTP206 HTTPSTATECODE(206,Partial Content)
58#define HTTP207 HTTPSTATECODE(207,Multi-Status)
59
60/*HTTP 3xx states*/
61#define HTTP300 HTTPSTATECODE(300,Multiple Choices)
62#define HTTP301 HTTPSTATECODE(301,Moved Permanently)
63#define HTTP302 HTTPSTATECODE(302,Found)
64#define HTTP303 HTTPSTATECODE(303,See Other)
65#define HTTP304 HTTPSTATECODE(304,Not Modified)
66#define HTTP305 HTTPSTATECODE(305,Use Proxy)
67#define HTTP307 HTTPSTATECODE(307,Temporary Redirect)
68
69/*HTTP 4xx states*/
70#define HTTP400 HTTPSTATECODE(400,Bad Request)
71#define HTTP401 HTTPSTATECODE(401,Unauthorized)
72#define HTTP403 HTTPSTATECODE(403,Forbidden)
73#define HTTP404 HTTPSTATECODE(404,Not Found)
74#define HTTP405 HTTPSTATECODE(405,Method Not Allowed)
75#define HTTP406 HTTPSTATECODE(406,Not Acceptable)
76#define HTTP407 HTTPSTATECODE(407,Proxy Authentication Required)
77#define HTTP408 HTTPSTATECODE(408,Request Time-out)
78#define HTTP409 HTTPSTATECODE(409,Conflict)
79#define HTTP410 HTTPSTATECODE(410,Gone)
80#define HTTP411 HTTPSTATECODE(411,Length Required)
81#define HTTP412 HTTPSTATECODE(412,Precondition Failed)
82#define HTTP413 HTTPSTATECODE(413,Request Entity Too Large)
83#define HTTP414 HTTPSTATECODE(414,Request-URI Too Long)
84#define HTTP415 HTTPSTATECODE(415,Unsupported Media Type)
85#define HTTP416 HTTPSTATECODE(416,Requested range not satisfiable)
86#define HTTP417 HTTPSTATECODE(417,Expectation Failed)
87#define HTTP418 HTTPSTATECODE(418,"I'm a teapot")
88#define HTTP421 HTTPSTATECODE(421,There are too many connections from your internet address)
89#define HTTP422 HTTPSTATECODE(422,Unprocessable Entity)
90#define HTTP423 HTTPSTATECODE(423,Locked)
91#define HTTP424 HTTPSTATECODE(424,Failed Dependency)
92#define HTTP425 HTTPSTATECODE(425,Unordered Collection)
93#define HTTP426 HTTPSTATECODE(426,Upgrade Required)
94
95/*HTTP 5xx states*/
96#define HTTP500 HTTPSTATECODE(500,Internal Server Error)
97#define HTTP501 HTTPSTATECODE(501,Not Implemented)
98#define HTTP502 HTTPSTATECODE(502,Bad Gateway)
99#define HTTP503 HTTPSTATECODE(503,Service Unavailable)
100#define HTTP504 HTTPSTATECODE(504,Gateway Time-out)
101#define HTTP505 HTTPSTATECODE(505,HTTP Version not supported)
102#define HTTP506 HTTPSTATECODE(506,Variant Also Negotiates)
103#define HTTP507 HTTPSTATECODE(507,Insufficient Storage)
104#define HTTP509 HTTPSTATECODE(509,Bandwidth Limit Exceeded)
105#define HTTP510 HTTPSTATECODE(510,Not Extended)