Module: kamailio Branch: master Commit: d93b1861c6e9be5991040d2da327d2f543d9f9ab URL: https://github.com/kamailio/kamailio/commit/d93b1861c6e9be5991040d2da327d2f5...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2019-08-13T09:15:43+02:00
http_client: docs for query_result parameter
---
Modified: src/modules/http_client/doc/http_client_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/d93b1861c6e9be5991040d2da327d2f5... Patch: https://github.com/kamailio/kamailio/commit/d93b1861c6e9be5991040d2da327d2f5...
---
diff --git a/src/modules/http_client/doc/http_client_admin.xml b/src/modules/http_client/doc/http_client_admin.xml index 70bcd2a433..55c65ccc97 100644 --- a/src/modules/http_client/doc/http_client_admin.xml +++ b/src/modules/http_client/doc/http_client_admin.xml @@ -36,10 +36,10 @@ <para> Like in SIP, the HTTP URL may need encoding to be transported safely over the network. Check the string encoding functions in the Transformation - Cookbook (as used in the http_client_query example below). + Cookbook (as used in the http_client_query() example below). </para> <para> - The function http_client_query allows &kamailio; to issue an HTTP GET + The function http_client_query() allows &kamailio; to issue an HTTP GET request and get access to parts of the reply. This function has been ported from the utils module and now use the same libcurl functions. We recommend using the new functionality provided by @@ -433,6 +433,31 @@ modparam("http_client", "authmethod", 3) <programlisting format="linespecific"> ... modparam("http_client", "keep_connections", 1) +... + </programlisting> + </example> + </section> + <section id="http_client.p.query_result"> + <title><varname>query_result</varname> (int)</title> + <para> + Control what is returned by the http_client_query(...) in the result + variable. + </para> + <para> + Valid values are: + <itemizedlist> + <listitem><para>0 - Return the entire HTTP result body</para></listitem> + <listitem><para>1 - Return the first oine from HTTP result body</para></listitem> + </itemizedlist> + </para> + <para> + Default value: 1 (return first line). + </para> + <example> + <title>Set <varname>query_result</varname> parameter</title> + <programlisting format="linespecific"> +... +modparam("http_client", "query_result", 0) ... </programlisting> </example> @@ -796,17 +821,18 @@ http_get_redirect("apiserver", "$var(targeturl)"); </para> <para> If HTTP server returns a class 2xx, 3xx or 4xx reply, - the first line of the reply's body (if any) is + the first line or the entire reply body (if any) is stored in <quote>result</quote> parameter, - which must be a writable pseudo variable. + which must be a writable pseudo variable. See the query_result + parameter for controling what value to be stored in the result + variable. </para> <para> Function returns reply code of HTTP reply or -1 if something went wrong. </para> <para> - This function can be used from REQUEST_ROUTE, - ONREPLY_ROUTE, FAILURE_ROUTE, and BRANCH_ROUTE. + This function can be used from ANY_ROUTE. </para> <para> Note that this function is based on the http_query function in the utils module.