MCPcopy Create free account
hub / github.com/acl-dev/acl / doPost

Method doPost

lib_acl_cpp/samples/cgi_upload/main.cpp:37–69  ·  view source on GitHub ↗

POST ����

Source from the content-addressed store, hash-verified

35
36 // POST ����
37 virtual bool doPost(HttpServletRequest& req, HttpServletResponse& res)
38 {
39 // ��� session ����ڣ�������
40#if 0
41 const char* sid = req.getSession().getAttribute("sid");
42 if (*sid == 0)
43 req.getSession().setAttribute("sid", "xxxxxx");
44#endif
45
46 // ���� HTTP ��Ӧͷ
47 res.addCookie("name1", "value1");
48 res.addCookie("name2", "value2", ".test.com", "/", 3600 * 24);
49// res.setStatus(400); // �������÷��ص�״̬��
50
51 // ���ַ�ʽ�����������ַ���
52 if (0)
53 res.setContentType("text/xml; charset=gb2312");
54 else
55 {
56 res.setContentType("text/xml");
57 res.setCharacterEncoding("gb2312");
58 }
59
60 // ��� HTTP ������������ͣ������IJ������ͣ��� name&value ��ʽ
61 // ���� MIME �������ͣ���������������
62 http_request_t request_type = req.getRequestType();
63 if (request_type == HTTP_REQUEST_NORMAL)
64 return doParams(req, res);
65 else if (request_type == HTTP_REQUEST_MULTIPART_FORM)
66 return doUpload(req, res);
67 assert(request_type == HTTP_REQUEST_OCTET_STREAM);
68 return doOctetStream(req, res);
69 }
70
71 bool doResponse(HttpServletRequest& req, HttpServletResponse& res)
72 {

Callers

nothing calls this directly

Calls 4

getAttributeMethod · 0.80
setAttributeMethod · 0.80
setContentTypeMethod · 0.80
getRequestTypeMethod · 0.80

Tested by

no test coverage detected