From b344ba0b527c0c0dd12063f6f8a37f13bddb317b Mon Sep 17 00:00:00 2001 From: Camille Oudot Date: Mon, 15 Feb 2016 18:43:00 +0100 Subject: [PATCH] http_async_client: update doc with $http_req(key) --- .../doc/http_async_client_admin.xml | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/modules/http_async_client/doc/http_async_client_admin.xml b/modules/http_async_client/doc/http_async_client_admin.xml index 1a53d2db458..45ac3b172c2 100644 --- a/modules/http_async_client/doc/http_async_client_admin.xml +++ b/modules/http_async_client/doc/http_async_client_admin.xml @@ -562,7 +562,33 @@ http_query("https://example.com/test.php", "HTTP_REPLY");
Pseudo Variables - The following pseudo variables can only be used in the callback routes executed by http_async_query() + The $http_req(key) write-only variable can be used to set custom parameters before sending a HTTP query + setting this variable has the same effect than using the http_set_*()functions + key can be one of: + + all: if set to $null, resets all the parameters to their default value (the ones defined in modparam) + hdr: sets/modifies/remove a HTTP header (see http_append_header()). N.B.: setting this variable multiple times will add several headers to the query. + method: sets the HTTP method (see http_set_method()) + timeout: sets the HTTP timeout (see http_set_timeout()) + tls_client_cert: sets the client certificate to use (see http_set_tls_client_cert()) + tls_client_key: sets the client certificate key to use (see http_set_tls_client_key()) + tls_ca_path: sets the CA certificate files to use (see http_set_tls_ca_path()) + + + <literal>$http_req(key)</literal> variable usage + +... +$http_req(all) = $null; # reset the parameters +$http_req(timeout) = 100; # 100 ms +$http_req(method) = "DELETE"; +$http_req(hdr) = "X-Sip-Call-Id: " + $ci; +$http_req(hdr) = "X-Foo: bar"; # add a 2nd header +# the following request will use the above parameters +http_query("https://example.com/test.php", "HTTP_REPLY"); +... + + + The following read-only pseudo variables can only be used in the callback routes executed by http_async_query() $http_ok: 1 if cURL executed the request successfully, 0 otherwise (check $ah_err for details) @@ -587,7 +613,6 @@ http_query("https://example.com/test.php", "HTTP_REPLY");
-
Statistics