Module: kamailio
Branch: master
Commit: 8a6f57f59963e53bcf98dd39615db3980275d81b
URL:
https://github.com/kamailio/kamailio/commit/8a6f57f59963e53bcf98dd39615db39…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2017-06-30T15:31:22+02:00
modules: readme files regenerated - http_client ... [skip ci]
---
Modified: src/modules/http_client/README
---
Diff:
https://github.com/kamailio/kamailio/commit/8a6f57f59963e53bcf98dd39615db39…
Patch:
https://github.com/kamailio/kamailio/commit/8a6f57f59963e53bcf98dd39615db39…
---
diff --git a/src/modules/http_client/README b/src/modules/http_client/README
index 7ee2d2f693..7f5718db5c 100644
--- a/src/modules/http_client/README
+++ b/src/modules/http_client/README
@@ -65,7 +65,7 @@ Hugh Waite
result)
4.2. http_get_redirect(connection, result)
- 4.3. http_client_query(url, [post-data], result)
+ 4.3. http_client_query(url, [post-data], [hdrs], result)
5. Pseudovariables
@@ -117,7 +117,7 @@ Hugh Waite
1.18. Short http_client config file
1.19. http_connect() usage
1.20. http_get_redirect() usage
- 1.21. curl_http_query() usage
+ 1.21. http_client_query() usage
Chapter 1. Admin Guide
@@ -153,7 +153,7 @@ Chapter 1. Admin Guide
4.1. http_connect(connection, url, [content_type, data,] result)
4.2. http_get_redirect(connection, result)
- 4.3. http_client_query(url, [post-data], result)
+ 4.3. http_client_query(url, [post-data], [hdrs], result)
5. Pseudovariables
@@ -609,7 +609,7 @@ http_follow_redirect = no
4.1. http_connect(connection, url, [content_type, data,] result)
4.2. http_get_redirect(connection, result)
- 4.3. http_client_query(url, [post-data], result)
+ 4.3. http_client_query(url, [post-data], [hdrs], result)
4.1. http_connect(connection, url, [content_type, data,] result)
@@ -667,7 +667,7 @@ modparam("http_client", "httpredirect", 1);
http_get_redirect("apiserver", "$var(targeturl)");
...
-4.3. http_client_query(url, [post-data], result)
+4.3. http_client_query(url, [post-data], [hdrs], result)
Sends HTTP GET or POST request according to URL given in “url”
parameter, which is a string that may contain pseudo variables.
@@ -675,6 +675,12 @@ http_get_redirect("apiserver",
"$var(targeturl)");
If you want to make a POST-Request, you have to define the “post”-data,
that should be submitted in that request as the second parameter.
+ Custom headers may be specified via “hdrs” parameter (e.g.,
+ Content-Type).
+
+ Either of “post-data” or “hdrs” can be also set to empty string in
+ order to be ignored.
+
If HTTP server returns a class 2xx, 3xx or 4xx reply, the first line of
the reply's body (if any) is stored in “result” parameter, which must
be a writable pseudo variable.
@@ -689,25 +695,26 @@ http_get_redirect("apiserver",
"$var(targeturl)");
utils module. It is changed to use the same base library and settings
as the rest of the functions in this module.
- Example 1.21. curl_http_query() usage
+ Example 1.21. http_client_query() usage
...
# GET-Request
http_client_query("http://api.com/index.php?r_uri=$(ru{s.escape.param})&f_uri=$(
fu{s.escape.param})",
"$var(result)");
-switch ($retcode) {
- ...
+switch ($rc) {
+ ...
}
...
-...
# POST-Request
-http_client_query("http://api.com/index.php",
"r_uri=$(ru{s.escape.param})&f_uri
-=$(fu{s.escape.param})",
- "$var(result)");
-switch ($retcode) {
- ...
+http_client_query("http://api.com/index.php",
+ "r_uri=$(ru{s.escape.param})&f_uri=$(fu{s.escape.param})",
+ "$var(result)");
}
...
+# POST-Request
+http_client_query("http://api.com/index.php", "src=$si",
+ "Content-Type: text/plain", "$var(result)");
+...
5. Pseudovariables