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

Method do_xml

lib_acl_cpp/samples/http_request/main.cpp:99–120  ·  view source on GitHub ↗

���� text/xml ��������

Source from the content-addressed store, hash-verified

97
98 // ���� text/xml ��������
99 bool do_xml(acl::http_request& req)
100 {
101 acl::xml1 body;
102 if (req.get_body(body, to_charset_) == false)
103 {
104 logger_error("get http body error");
105 return false;
106 }
107 acl::xml_node* node = body.first_node();
108 while (node)
109 {
110 const char* tag = node->tag_name();
111 const char* name = node->attr_value("name");
112 const char* pass = node->attr_value("pass");
113 printf(">>tag: %s, name: %s, pass: %s\r\n",
114 tag ? tag : "null",
115 name ? name : "null",
116 pass ? pass : "null");
117 node = body.next_node();
118 }
119 return true;
120 }
121
122 // ���� text/json ��������
123 bool do_json(acl::http_request& req)

Callers

nothing calls this directly

Calls 5

get_bodyMethod · 0.45
first_nodeMethod · 0.45
tag_nameMethod · 0.45
attr_valueMethod · 0.45
next_nodeMethod · 0.45

Tested by

no test coverage detected