{
    "content": [
        {
            "type": "text",
            "text": "# XML::RPC (perldoc)\n\n## NAME\n\nXML::RPC -- Pure Perl implementation for an XML-RPC client and server.\n\n## SYNOPSIS\n\nmake a call to an XML-RPC server:\nuse XML::RPC;\nmy $xmlrpc = XML::RPC->new('http://betty.userland.com/RPC2');\nmy $result = $xmlrpc->call( 'examples.getStateStruct', { state1 => 12, state2 => 28 } );\ncreate an XML-RPC service:\nuse XML::RPC;\nuse CGI;\nmy $q      = new CGI;\nmy $xmlrpc = XML::RPC->new();\nmy $xml    = $q->param('POSTDATA');\nprint $q->header( -type => 'text/xml', -charset => 'UTF-8' );\nprint $xmlrpc->receive( $xml, \\&handler );\nsub handler {\nmy ( $methodname, @params ) = @;\nreturn { youcalled => $methodname, withparams => \\@params };\n}\n\n## DESCRIPTION\n\nXML::RPC module provides simple Pure Perl methods for XML-RPC communication. It's goals are\nsimplicity and flexibility. XML::RPC uses XML::TreePP for parsing.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **CONSTRUCTOR AND OPTIONS**\n- **METHODS**\n- **CUSTOM TYPES**\n- **ERROR HANDLING**\n- **PROXY SUPPORT**\n- **LIMITATIONS**\n- **AUTHOR**\n- **COPYRIGHT AND LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "XML::RPC",
        "section": "",
        "mode": "perldoc",
        "summary": "XML::RPC -- Pure Perl implementation for an XML-RPC client and server.",
        "synopsis": "make a call to an XML-RPC server:\nuse XML::RPC;\nmy $xmlrpc = XML::RPC->new('http://betty.userland.com/RPC2');\nmy $result = $xmlrpc->call( 'examples.getStateStruct', { state1 => 12, state2 => 28 } );\ncreate an XML-RPC service:\nuse XML::RPC;\nuse CGI;\nmy $q      = new CGI;\nmy $xmlrpc = XML::RPC->new();\nmy $xml    = $q->param('POSTDATA');\nprint $q->header( -type => 'text/xml', -charset => 'UTF-8' );\nprint $xmlrpc->receive( $xml, \\&handler );\nsub handler {\nmy ( $methodname, @params ) = @;\nreturn { youcalled => $methodname, withparams => \\@params };\n}",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 24,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "CONSTRUCTOR AND OPTIONS",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 14,
                "subsections": []
            },
            {
                "name": "CUSTOM TYPES",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "ERROR HANDLING",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "PROXY SUPPORT",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "LIMITATIONS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYRIGHT AND LICENSE",
                "lines": 3,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "XML::RPC -- Pure Perl implementation for an XML-RPC client and server.\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "make a call to an XML-RPC server:\n\nuse XML::RPC;\n\nmy $xmlrpc = XML::RPC->new('http://betty.userland.com/RPC2');\nmy $result = $xmlrpc->call( 'examples.getStateStruct', { state1 => 12, state2 => 28 } );\n\ncreate an XML-RPC service:\n\nuse XML::RPC;\nuse CGI;\n\nmy $q      = new CGI;\nmy $xmlrpc = XML::RPC->new();\nmy $xml    = $q->param('POSTDATA');\n\nprint $q->header( -type => 'text/xml', -charset => 'UTF-8' );\nprint $xmlrpc->receive( $xml, \\&handler );\n\nsub handler {\nmy ( $methodname, @params ) = @;\nreturn { youcalled => $methodname, withparams => \\@params };\n}\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "XML::RPC module provides simple Pure Perl methods for XML-RPC communication. It's goals are\nsimplicity and flexibility. XML::RPC uses XML::TreePP for parsing.\n",
                "subsections": []
            },
            "CONSTRUCTOR AND OPTIONS": {
                "content": "$xmlrpc = XML::RPC->new();\nThis constructor method returns a new XML::RPC object. Usable for XML-RPC servers.\n\n$xmlrpc = XML::RPC->new( 'http://betty.userland.com/RPC2', %options );\nIts first argument is the full URL for your server. The second argument is for options passing\nto XML::TreePP, for example: outputencoding => 'ISO-8859-1' (default is UTF-8).\n",
                "subsections": []
            },
            "METHODS": {
                "content": "$xmlrpc->call( 'methodname', @arguments );\nThis method calls the provides XML-RPC server's methodname with @arguments. It will return the\nserver method's response.\n\n$xmlrpc->receive( $xml, \\&handler );\nThis parses an incoming XML-RPC methodCall and call the \\&handler subref with parameters:\n$methodName and @parameters.\n\n$xmlrpc->xmlin();\nReturns the last XML that went in the client.\n\n$xmlrpc->xmlout();\nReturns the last XML that went out the client.\n",
                "subsections": []
            },
            "CUSTOM TYPES": {
                "content": "$xmlrpc->call( 'methodname', { data => sub { { 'base64' => encodebase64($data) } } } );\nWhen passing a CODEREF to a value XML::RPC will simply use the returned hashref as a type =>\nvalue pair.\n",
                "subsections": []
            },
            "ERROR HANDLING": {
                "content": "To provide an error response you can simply die() in the \\&handler function. Also you can set\nthe $XML::RPC::faultCode variable to a (int) value just before dieing.\n",
                "subsections": []
            },
            "PROXY SUPPORT": {
                "content": "Default XML::RPC will try to use LWP::Useragent for requests, you can set the environment\nvariable: CGIHTTPPROXY to set a proxy.\n",
                "subsections": []
            },
            "LIMITATIONS": {
                "content": "XML::RPC will not create \"bool\", \"dateTime.iso8601\" or \"base64\" types automatically. They will\nbe parsed as \"int\" or \"string\". You can use the CODE ref to create these types.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Niek Albers, http://www.daansystems.com/\n",
                "subsections": []
            },
            "COPYRIGHT AND LICENSE": {
                "content": "Copyright (c) 2007-2008 Niek Albers. All rights reserved. This program is free software; you can\nredistribute it and/or modify it under the same terms as Perl itself.\n",
                "subsections": []
            }
        }
    }
}