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

Method get_body

lib_acl_cpp/src/http/http_request.cpp:790–826  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

788}
789
790bool http_request::get_body(xml& out, const char* to_charset /* = NULL */)
791{
792 if (client_ == NULL) {
793 logger_error("connection not opened yet");
794 return false;
795 }
796
797 http_pipe* hp = get_pipe(to_charset);
798 if (hp) {
799 hp->append(&out);
800 }
801
802 string buf(4096);
803 int ret;
804
805 // �� HTTP ��Ӧ�壬���� xml ��ʽ���з���
806 while (true) {
807 // ���ÿ����Զ���ѹ���Ķ�����
808 ret = client_->read_body(buf);
809 if (ret < 0) {
810 break;
811 } else if (ret == 0) {
812 break;
813 }
814 if (hp) {
815 hp->update(buf.c_str(), ret);
816 } else {
817 out.update(buf.c_str());
818 }
819 }
820
821 if (hp) {
822 hp->update_end();
823 delete hp;
824 }
825 return true;
826}
827
828bool http_request::get_body(json& out, const char* to_charset /* = NULL */)
829{

Callers 15

startFunction · 0.45
http_requestFunction · 0.45
do_plainMethod · 0.45
do_xmlMethod · 0.45
do_jsonMethod · 0.45
http_clientFunction · 0.45
onUrlGetMethod · 0.45
HttpGetFunction · 0.45
getMethod · 0.45
getMethod · 0.45
HttpGetFunction · 0.45
runMethod · 0.45

Calls 6

pipe_stringClass · 0.50
appendMethod · 0.45
read_bodyMethod · 0.45
updateMethod · 0.45
c_strMethod · 0.45
update_endMethod · 0.45

Tested by 1

runMethod · 0.36