浏览代码

nghttp2: docs for nghttp2_reply_header(...) function

Daniel-Constantin Mierla 1 年之前
父节点
当前提交
3439eb4408
共有 1 个文件被更改,包括 25 次插入3 次删除
  1. 25 3
      src/modules/nghttp2/doc/nghttp2_admin.xml

+ 25 - 3
src/modules/nghttp2/doc/nghttp2_admin.xml

@@ -129,17 +129,39 @@ end
 	<title>Functions</title>
 	<section id="nghttp2.f.nghttp2_reply">
 	    <title>
-		<function moreinfo="none">nghttp2_reply(code, reason, ctype, body)</function>
+		<function moreinfo="none">nghttp2_reply(code, body)</function>
 	    </title>
 	    <para>
-		Send back a reply with content-type and body.
+		Send back a reply with body. The body can be empty string. Both parameters
+		can contain variables.
 	    </para>
 		<example>
 		<title><function>nghttp2_reply</function> usage</title>
 		<programlisting format="linespecific">
 ...
 event_route[nghttp2:request] {
-    nghttp2_reply("200", "OK", "text/html",
+    nghttp2_reply("200",
+        "&lt;html&gt;&lt;body&gt;OK&lt;/body&gt;&lt;/html&gt;");
+}
+...
+</programlisting>
+	    </example>
+	</section>
+	<section id="nghttp2.f.nghttp2_reply_header">
+	    <title>
+		<function moreinfo="none">nghttp2_reply_header(name, value)</function>
+	    </title>
+	    <para>
+		Set a header to be added to reply. There can be up to 15 headers.
+	    </para>
+		<example>
+		<title><function>nghttp2_reply</function> usage</title>
+		<programlisting format="linespecific">
+...
+event_route[nghttp2:request] {
+    nghttp2_reply_header("Content-Type", "text/html");
+    nghttp2_reply_header("My-Header", "xyz");
+    nghttp2_reply("200",
         "&lt;html&gt;&lt;body&gt;OK&lt;/body&gt;&lt;/html&gt;");
 }
 ...