Commit 2ce301ca authored by Ross Burton's avatar Ross Burton
Browse files

Add rest_proxy_call_get_payload_as_xml

parent 1e97f492
......@@ -1220,3 +1220,25 @@ rest_proxy_call_get_status_message (RestProxyCall *call)
return priv->status_message;
}
RestXmlNode *
rest_proxy_call_get_payload_as_xml (RestProxyCall *call)
{
RestProxyCallPrivate *priv;
static RestXmlParser *parser = NULL;
RestXmlNode *root;
g_return_val_if_fail (REST_IS_PROXY_CALL (call), NULL);
priv = GET_PRIVATE (call);
if (parser == NULL)
parser = rest_xml_parser_new ();
root = rest_xml_parser_parse_from_data_full (parser,
priv->payload,
priv->length,
priv->url,
g_hash_table_lookup (priv->content_params, "charset"));
return root;
}
......@@ -25,6 +25,7 @@
#include <glib-object.h>
#include <rest/rest-params.h>
#include <rest/rest-xml-parser.h>
G_BEGIN_DECLS
......@@ -185,6 +186,8 @@ const gchar *rest_proxy_call_get_payload (RestProxyCall *call);
guint rest_proxy_call_get_status_code (RestProxyCall *call);
const gchar *rest_proxy_call_get_status_message (RestProxyCall *call);
RestXmlNode *rest_proxy_call_get_payload_as_xml (RestProxyCall *call);
G_END_DECLS
#endif /* _REST_PROXY_CALL */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment