Module: kamailio
Branch: master
Commit: ef29e84929b8ef779341ef63a77e68ca6909705a
URL:
https://github.com/kamailio/kamailio/commit/ef29e84929b8ef779341ef63a77e68c…
Author: Elena-Ramona Modroiu <ramona(a)asipto.com>
Committer: Elena-Ramona Modroiu <ramona(a)asipto.com>
Date: 2024-03-11T07:18:17+01:00
http_client: docs for http_client_request() function
---
Modified: src/modules/http_client/doc/http_client_admin.xml
---
Diff:
https://github.com/kamailio/kamailio/commit/ef29e84929b8ef779341ef63a77e68c…
Patch:
https://github.com/kamailio/kamailio/commit/ef29e84929b8ef779341ef63a77e68c…
---
diff --git a/src/modules/http_client/doc/http_client_admin.xml
b/src/modules/http_client/doc/http_client_admin.xml
index 0e182cc95e3..df9d8c288e5 100644
--- a/src/modules/http_client/doc/http_client_admin.xml
+++ b/src/modules/http_client/doc/http_client_admin.xml
@@ -960,6 +960,30 @@
http_client_get("http://api.com/index.php?r_uri=$(ru{s.escape.param})&f_uri=
switch ($rc) {
...
}
+...
+ </programlisting>
+ </example>
+ </section>
+ <section id="http_client.f.http_client_request">
+ <title>
+ <function moreinfo="none">http_client_request(url, met, body, hdrs,
respv)</function>
+ </title>
+ <para>
+ Perform a HTTP request to "url", storing the response body
+ in the "respv" variable. The method of the request is set by
"met".
+ The "body" and "hdrs" can be empty strings to skip setting them.
+ The first four parameters can contain variables that are evaluated
+ at runtime. The "respv" has to be the name of a writable variable.
+ </para>
+ <example>
+ <title><function>http_client_request()</function>
usage</title>
+ <programlisting format="linespecific">
+...
+http_client_request("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>