Skip to content

Commit

Permalink
http_client: docs for query_result parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Aug 13, 2019
1 parent d07b522 commit d93b186
Showing 1 changed file with 32 additions and 6 deletions.
38 changes: 32 additions & 6 deletions src/modules/http_client/doc/http_client_admin.xml
Expand Up @@ -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
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit d93b186

Please sign in to comment.