Module: kamailio
Branch: master
Commit: 729340ff8c80ac836f1889c505cf361abc4fe0ae
URL:
https://github.com/kamailio/kamailio/commit/729340ff8c80ac836f1889c505cf361…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-12-21T10:29:28+01:00
http_client: docs for http_client_get()
---
Modified: src/modules/http_client/doc/http_client_admin.xml
---
Diff:
https://github.com/kamailio/kamailio/commit/729340ff8c80ac836f1889c505cf361…
Patch:
https://github.com/kamailio/kamailio/commit/729340ff8c80ac836f1889c505cf361…
---
diff --git a/src/modules/http_client/doc/http_client_admin.xml
b/src/modules/http_client/doc/http_client_admin.xml
index 6f1c897690..2c8295f07f 100644
--- a/src/modules/http_client/doc/http_client_admin.xml
+++ b/src/modules/http_client/doc/http_client_admin.xml
@@ -897,6 +897,35 @@ http_client_query("http://api.com/index.php",
# POST-Request
http_client_query("http://api.com/index.php", "src=$si",
"Content-Type: text/plain", "$var(result)");
+...
+ </programlisting>
+ </example>
+ </section>
+ <section id="http_client.f.http_get">
+ <title>
+ <function moreinfo="none">http_client_get(url, body, hdrs,
respv)</function>
+ </title>
+ <para>
+ Perform a HTTP GET request to "url", storing the response body
+ in the "respv" variable. The "body" and "hdrs" can be
empty strings
+ to skip setting them. The first three parameters can contain
+ variables that are evaluated at runtime. The "respv" has to be
+ the name of a writable variable.
+ </para>
+ <para>
+ Note: usually HTTP GET requests should have no body, according to
+ specs the body in HTTP GET does not affect the response, but is
+ not explicitely forbidden.
+ </para>
+ <example>
+ <title><function>http_client_get()</function> usage</title>
+ <programlisting format="linespecific">
+...
+http_client_get("http://api.com/index.php?r_uri=$(ru{s.escape.param})&f_uri=$(fu{s.escape.param})",
+ "", "X-Token: abc", "$var(result)");
+switch ($rc) {
+ ...
+}
...
</programlisting>
</example>