���� text/plain ������
| 78 | private: |
| 79 | // ���� text/plain ������ |
| 80 | bool do_plain(http_response& res, const char* req_charset, string& err) { |
| 81 | string body; |
| 82 | if (res.get_body(body, local_charset_) == false) { |
| 83 | err += "get_body error"; |
| 84 | return false; |
| 85 | } |
| 86 | printf("body:\r\n(%s)\r\n", body.c_str()); |
| 87 | |
| 88 | // ������Ӧͷ�ֶ� |
| 89 | http_header& header = res.response_header(); |
| 90 | string ctype("text/plain"); |
| 91 | if (req_charset) { |
| 92 | ctype << "; charset=" << req_charset; |
| 93 | header.set_content_type(ctype); |
| 94 | } else { |
| 95 | header.set_content_type(ctype); |
| 96 | } |
| 97 | |
| 98 | printf(">>ctype: %s\r\n", ctype.c_str()); |
| 99 | |
| 100 | // ������Ӧ������ |
| 101 | return response_body(res, body, req_charset); |
| 102 | } |
| 103 | |
| 104 | // ���� text/xml ������ |
| 105 | bool do_xml(http_response& res, const char* req_charset, string& err) { |
nothing calls this directly
no test coverage detected