aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-07-08 15:11:11 +0100
committerMatthew Wild <mwild1@gmail.com>2009-07-08 15:11:11 +0100
commitddf0fa83fd3d7a11814ea9f442d4602fc7fd5def (patch)
tree14c3194f0926f24d7930192f27d4bde6bfe79b5d /util
parent4300741747d8cee2589d236c9c89b45ca20a3834 (diff)
downloadprosody-ddf0fa83fd3d7a11814ea9f442d4602fc7fd5def.tar.gz
prosody-ddf0fa83fd3d7a11814ea9f442d4602fc7fd5def.zip
util.xmlrpc: Add create_request
Diffstat (limited to 'util')
-rw-r--r--util/xmlrpc.lua8
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)