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 
19 const int PARSE_DATASTART = -1;
20 const int PARSE_DATAEND = -2;
21 
32 
37 
42 size_t formUrlParser(HttpRequest& request, const char* at, int length);
43 
49 size_t bodyToStringParser(HttpRequest& request, const char* at, int length);
const int PARSE_DATASTART
special length values passed to parse functions
Definition: HttpBodyParser.h:19
const int PARSE_DATAEND
End of incoming data.
Definition: HttpBodyParser.h:20
Delegate< size_t(HttpRequest &request, const char *at, int length)> HttpBodyParserDelegate
Body parser callback delegate.
Definition: HttpBodyParser.h:31
size_t bodyToStringParser(HttpRequest &request, const char *at, int length)
Stores the complete body into memory.
Definition: HttpRequest.h:35
size_t formUrlParser(HttpRequest &request, const char *at, int length)
Parses application/x-www-form-urlencoded body data.
HashMap< String, HttpBodyParserDelegate > BodyParsers
Maps body parsers to a specific content type.
Definition: HttpBodyParser.h:36