-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathPostForm.h
47 lines (34 loc) · 840 Bytes
/
PostForm.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//
// Created by Alone on 2022-7-21.
//
#ifndef MYUTIL_POSTFORM_H
#define MYUTIL_POSTFORM_H
#include "common.h"
#include <map>
#include <string>
#include <string_view>
#include <vector>
namespace http
{
using std::map;
using std::string;
using std::vector;
using std::string_view;
class PostForm
{
public:
using post_form_t = map<string, vector<string>>;
static PostForm FromData(string_view content, ACCEPT_CONTENT_TYPE type);
void ParseQueryUrlData(string_view content);
void ParseMultFormData(string_view content);
string Query(string const &key);
post_form_t &From()
{
return m_postform;
}
private:
http::ACCEPT_CONTENT_TYPE m_post_type;
post_form_t m_postform;
};
}
#endif // MYUTIL_POSTFORM_H