HttpBodyParser.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  * HttpBodyParser.h
8  *
9  * @author: 2017 - Slavey Karadzhov <slav@attachix.com>
10  *
11  ****/
12 
13 #pragma once
14 
15 #include "HttpCommon.h"
16 #include "HttpRequest.h"
17 
24 const int PARSE_DATASTART = -1;
25 const int PARSE_DATAEND = -2;
26 
36 using HttpBodyParserDelegate = Delegate<size_t(HttpRequest& request, const char* at, int length)>;
37 
42 
47 size_t formUrlParser(HttpRequest& request, const char* at, int length);
48 
54 size_t bodyToStringParser(HttpRequest& request, const char* at, int length);
55 
const int PARSE_DATASTART
special length values passed to parse functions
Definition: HttpBodyParser.h:24
const int PARSE_DATAEND
End of incoming data.
Definition: HttpBodyParser.h:25
size_t bodyToStringParser(HttpRequest &request, const char *at, int length)
Stores the complete body into memory.
size_t formUrlParser(HttpRequest &request, const char *at, int length)
Parses application/x-www-form-urlencoded body data.
Encapsulates an incoming or outgoing request.
Definition: HttpRequest.h:36