���� text/json ��������
| 121 | |
| 122 | // ���� text/json �������� |
| 123 | bool do_json(acl::http_request& req) |
| 124 | { |
| 125 | acl::json body; |
| 126 | if (req.get_body(body, to_charset_) == false) |
| 127 | { |
| 128 | logger_error("get http body error"); |
| 129 | return false; |
| 130 | } |
| 131 | |
| 132 | acl::json_node* node = body.first_node(); |
| 133 | while (node) |
| 134 | { |
| 135 | if (node->tag_name()) |
| 136 | { |
| 137 | printf("tag: %s", node->tag_name()); |
| 138 | if (node->get_text()) |
| 139 | printf(", value: %s\r\n", node->get_text()); |
| 140 | else |
| 141 | printf("\r\n"); |
| 142 | } |
| 143 | node = body.next_node(); |
| 144 | } |
| 145 | return true; |
| 146 | } |
| 147 | |
| 148 | private: |
| 149 | acl::string server_addr_; // web ��������ַ |
nothing calls this directly
no test coverage detected