HttpCommon.h
Go to the documentation of this file.
1 /****
2  * Sming Framework Project - Open Source framework for high efficiency native ESP8266 development.
3  * Created 2015 by Skurydin Alexey
4  * http://github.com/SmingHub/Sming
5  * All files of the Sming Core are provided under the LGPL v3 license.
6  *
7  * HttpCommon.h
8  *
9  * @author: 2017 - Slavey Karadzhov <slav@attachix.com>
10  *
11  ****/
12 
13 #pragma once
14 
15 #define ENABLE_HTTP_REQUEST_AUTH 1
16 
17 #include "WString.h"
18 #include "../WebConstants.h"
19 #include "../Url.h"
21 #include "Data/ObjectMap.h"
22 
23 #ifndef HTTP_MAX_HEADER_SIZE
24 #define HTTP_MAX_HEADER_SIZE (8 * 1024)
25 #endif
26 
27 /* Number of maximum tcp connections to be kept in the pool */
28 #ifndef HTTP_REQUEST_POOL_SIZE
29 #define HTTP_REQUEST_POOL_SIZE 20
30 #endif
31 
32 #include "http-parser/http_parser.h"
33 
34 typedef enum http_method HttpMethod;
35 
43 };
44 
46 
53 String httpGetErrorName(enum http_errno err);
54 
60 String httpGetErrorDescription(enum http_errno err);
61 
67 String httpGetStatusText(enum http_status code);
68 
74 static inline String httpGetStatusText(unsigned code)
75 {
76  return httpGetStatusText((enum http_status)code);
77 }
String httpGetStatusText(enum http_status code)
Return a descriptive string for an HTTP status code.
The String class.
Definition: WString.h:136
Definition: HttpCommon.h:42
enum http_method HttpMethod
Definition: HttpCommon.h:34
String httpGetErrorDescription(enum http_errno err)
Return a descriptive string for the given error.
ObjectMap< String, ReadWriteStream > HttpFiles
Definition: HttpCommon.h:45
Definition: HttpCommon.h:37
Definition: HttpCommon.h:41
String httpGetErrorName(enum http_errno err)
Return a string name of the given error.
Definition: HttpCommon.h:40
Definition: HttpCommon.h:39
HttpConnectionState
Definition: HttpCommon.h:36
Definition: HttpCommon.h:38