From 9764a88dbbd3f249392570f1d309602072694427 Mon Sep 17 00:00:00 2001 From: Jarrod Baumann Date: Tue, 5 May 2015 14:51:05 -0500 Subject: [PATCH] Added documentation for rest_client:rest_append_hf command --- modules/rest_client/doc/rest_client_admin.xml | 46 +++++++++++++++++-- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/modules/rest_client/doc/rest_client_admin.xml b/modules/rest_client/doc/rest_client_admin.xml index 3bd07c92a12..e88dd0e0e3e 100644 --- a/modules/rest_client/doc/rest_client_admin.xml +++ b/modules/rest_client/doc/rest_client_admin.xml @@ -1,14 +1,14 @@ - + &adminguide;
Overview The rest_client module provides a means of interacting - with an HTTP server by doing RESTful queries, such as GET and POST. + with an HTTP server by doing RESTful queries, such as GET and POST.
@@ -31,7 +31,7 @@
External Libraries or Applications - The following libraries or applications must be installed before + The following libraries or applications must be installed before running &osips; with this module loaded: @@ -213,7 +213,7 @@ if (!rest_get("http://getcredit.org/?ruri=$fU", "$var(credit)", "$var(ct)", "$va Issues an HTTP POST request to the specified url. The request body will be copied from the send_body_pv pseudo-variable. The MIME Content-Type - header for the request will be taken from send_ctype_pv (default is + header for the request will be taken from send_ctype_pv (default is "application/x-www-form-urlencoded") @@ -259,6 +259,43 @@ if (!rest_post("http://myserver.org/register_user", "$fU", , "$var(body)", "$var
+
+ + <function moreinfo="none">rest_append_hf(txt)</function> + + + Appends 'txt' to the HTTP headers of the subsequent request. + Multiple headers can be appended by making multiple calls + before executing a request. + + + The contents of txt should adhere to the + specification for HTTP headers (ex. Field: Value) + + Parameter types + + + txt - String, pseudo-variable, or a String which includes pseudo-variables. (useful for specifying additional attribute-value fields in the URL) + + + + + This function can be used from the startup, branch, failure, request and timer routes. + + + <function moreinfo="none">rest_append_hf</function> usage + +... +# Example of querying a REST service requiring additional headers + +rest_append_hf("Authorization: Bearer mF_9.B5f-4.1JqM"); +if (!rest_get("http://getcredit.org/?ruri=$fU", "$var(credit)")) { + ... +} +... + + +
@@ -333,4 +370,3 @@ route [resume] -