Pārlūkot izejas kodu

http_client: docs for http_client_request() function

Elena-Ramona Modroiu 1 gadu atpakaļ
vecāks
revīzija
ef29e84929
1 mainītis faili ar 24 papildinājumiem un 0 dzēšanām
  1. 24 0
      src/modules/http_client/doc/http_client_admin.xml

+ 24 - 0
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})&amp;f_uri=$(fu{s.escape.param})",
+	   "", "X-Token: abc", "$var(result)");
+switch ($rc) {
+    ...
+}
 ...
 				</programlisting>
 			</example>