diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-07-08 15:11:11 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-07-08 15:11:11 +0100 |
commit | ddf0fa83fd3d7a11814ea9f442d4602fc7fd5def (patch) | |
tree | 14c3194f0926f24d7930192f27d4bde6bfe79b5d | |
parent | 4300741747d8cee2589d236c9c89b45ca20a3834 (diff) | |
download | prosody-ddf0fa83fd3d7a11814ea9f442d4602fc7fd5def.tar.gz prosody-ddf0fa83fd3d7a11814ea9f442d4602fc7fd5def.zip |
util.xmlrpc: Add create_request
-rw-r--r-- | util/xmlrpc.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/util/xmlrpc.lua b/util/xmlrpc.lua index 0c6b5efe..2c256aa1 100644 --- a/util/xmlrpc.lua +++ b/util/xmlrpc.lua @@ -66,6 +66,14 @@ function create_error_response(faultCode, faultString) return stanza; end +function create_request(method_name, object) + local stanza = st.stanza("methodCall") + :tag("methodName"):text(method_name):up() + :tag("params"):tag("param"):tag("value"); + _lua_to_xmlrpc(stanza, object); + stanza:up():up():up(); + return stanza; +end local _xmlrpc_to_lua; local int_parse = function(stanza) |