libhttppp ..

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