正在显示
1 个修改的文件
包含
44 行增加
和
0 行删除
src/server/dmpspserverrequest.cpp
0 → 100644
1 | +/************************************************************************** | ||
2 | + * file: dmpspserverrequest.cpp | ||
3 | + | ||
4 | + * Author: wanzhongping | ||
5 | + * Date: 2021-01-14 21:59:49 | ||
6 | + * Email: zhongpingw@chinadci.com | ||
7 | + * copyright: 广州城市信息研究所有限公司 | ||
8 | + ***************************************************************************/ | ||
9 | +#include "dmpspserverrequest.h" | ||
10 | +#include <boost/regex.hpp> | ||
11 | + | ||
12 | +DmpSpServerRequest::DmpSpServerRequest(SP_HttpRequest* request) | ||
13 | +{ | ||
14 | + const char * med = request->getMethod(); | ||
15 | + if (med) | ||
16 | + { | ||
17 | + if (strcmp(med,"POST") == 0) | ||
18 | + { | ||
19 | + set_method(POST_METHOD); | ||
20 | + } | ||
21 | + else | ||
22 | + { | ||
23 | + set_method(GET_METHOD); | ||
24 | + } | ||
25 | + } | ||
26 | + | ||
27 | + //获取querystring | ||
28 | + // std::string url(request->getURL()); | ||
29 | + // std::string::size_type pos = url.find("?"); | ||
30 | + // if (pos != std::string::npos) { | ||
31 | + // std::string query_string; | ||
32 | + // query_string = url.substr(pos+1,url.length()); | ||
33 | + // set_query(query_string); | ||
34 | + // } | ||
35 | + | ||
36 | + for(int i=0; i< request->getParamCount(); i++) { | ||
37 | + SetParameter(request->getParamName(i), request->getParamValue(i)); | ||
38 | + } | ||
39 | + | ||
40 | + //添加请求头信息 | ||
41 | + for(int i=0; i< request->getHeaderCount(); i++) { | ||
42 | + set_header(request->getHeaderName(i),request->getHeaderValue(i)); | ||
43 | + } | ||
44 | +} |
请
注册
或
登录
后发表评论