comparison xml/en/docs/njs/reference.xml @ 2958:b2bb7aa090da

Updated ngx.fetch description in njs Reference.
author Yaroslav Zhuravlev <yar@nginx.com>
date Tue, 09 May 2023 08:43:05 +0100
parents 4939c98e2f25
children 576e06abd683
comparison
equal deleted inserted replaced
2957:cebca5ba84d7 2958:b2bb7aa090da
7 <!DOCTYPE article SYSTEM "../../../../dtd/article.dtd"> 7 <!DOCTYPE article SYSTEM "../../../../dtd/article.dtd">
8 8
9 <article name="Reference" 9 <article name="Reference"
10 link="/en/docs/njs/reference.html" 10 link="/en/docs/njs/reference.html"
11 lang="en" 11 lang="en"
12 rev="103"> 12 rev="104">
13 13
14 <section id="summary"> 14 <section id="summary">
15 15
16 <para> 16 <para>
17 <link doc="index.xml">njs</link> provides objects, methods and properties 17 <link doc="index.xml">njs</link> provides objects, methods and properties
1159 </tag-desc> 1159 </tag-desc>
1160 1160
1161 <tag-name id="ngx_fetch"><literal>ngx.fetch(<value>resource</value>, 1161 <tag-name id="ngx_fetch"><literal>ngx.fetch(<value>resource</value>,
1162 [<value>options</value>])</literal></tag-name> 1162 [<value>options</value>])</literal></tag-name>
1163 <tag-desc> 1163 <tag-desc>
1164 <para>
1164 Makes a request to fetch a <value>resource</value> 1165 Makes a request to fetch a <value>resource</value>
1165 (<link doc="changes.xml" id="njs0.5.1">0.5.1</link>), which can be an 1166 (<link doc="changes.xml" id="njs0.5.1">0.5.1</link>), which can be an
1166 URL or the <link id="request"><literal>Request</literal></link> object 1167 URL or the <link id="request"><literal>Request</literal></link> object
1167 (<link doc="changes.xml" id="njs0.7.10">0.7.10</link>). 1168 (<link doc="changes.xml" id="njs0.7.10">0.7.10</link>).
1168 Returns a <literal>Promise</literal> that resolves with 1169 Returns a <literal>Promise</literal> that resolves with
1169 the <link id="response"><literal>Response</literal></link> object. 1170 the <link id="response"><literal>Response</literal></link> object.
1170 Since <link doc="changes.xml" id="njs0.7.0">0.7.0</link>, 1171 Since <link doc="changes.xml" id="njs0.7.0">0.7.0</link>,
1171 the <literal>https://</literal> scheme is supported, 1172 the <literal>https://</literal> scheme is supported,
1172 redirects are not handled. 1173 redirects are not handled.
1174 </para>
1175
1176 <para>
1177 If the URL in the <value>resource</value> is specified as a domain name,
1178 it is determined using a
1179 <link doc="../http/ngx_http_core_module.xml" id="resolver"/>.
1180 If the <literal>https://</literal> scheme is specified, the
1181 <link doc="../http/ngx_http_js_module.xml" id="js_fetch_trusted_certificate"/>
1182 directive should be configured
1183 for the authentication of the <value>resource</value>'s HTTPS server.
1184 </para>
1185
1173 <para> 1186 <para>
1174 The <literal>options</literal> parameter is expected to be an object 1187 The <literal>options</literal> parameter is expected to be an object
1175 with the following keys: 1188 with the following keys:
1176 <list type="tag"> 1189 <list type="tag">
1177 1190