Mercurial > hg > nginx-site
annotate xml/ru/docs/njs/reference.xml @ 2326:5d045e964270
Moved the repository introduction paragraph to an appropriate place.
author | Konstantin Pavlov <thresh@videolan.org> |
---|---|
date | Wed, 30 Jan 2019 13:05:02 +0300 |
parents | 3a8d96efece6 |
children | 9d502d4305ac |
rev | line source |
---|---|
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
1 <?xml version="1.0"?> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
2 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
3 <!-- |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
4 Copyright (C) Nginx, Inc. |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
5 --> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
6 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
7 <!DOCTYPE article SYSTEM "../../../../dtd/article.dtd"> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
8 |
2246
32ba43abf9cd
Renamed njs API, njs Changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2244
diff
changeset
|
9 <article name="Справочник" |
32ba43abf9cd
Renamed njs API, njs Changes.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2244
diff
changeset
|
10 link="/ru/docs/njs/reference.html" |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
11 lang="ru" |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
12 rev="1"> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
13 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
14 <section id="summary"> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
15 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
16 <para> |
2244
467aef18bf12
Renamed the "About njs" page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2189
diff
changeset
|
17 <link doc="index.xml">njs</link> предоставляет объекты, методы и свойства |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
18 для расширения функциональности nginx. |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
19 </para> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
20 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
21 </section> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
22 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
23 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
24 <section id="http_stream" name="Объекты nginx"> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
25 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
26 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
27 <section id="http" name="HTTP-запрос"> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
28 |
2189
23cfb62121d1
Mentioned byte strings for njs HTTP and stream objects.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2182
diff
changeset
|
29 <para> |
23cfb62121d1
Mentioned byte strings for njs HTTP and stream objects.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2182
diff
changeset
|
30 Объект <literal>HTTP</literal> доступен только в |
23cfb62121d1
Mentioned byte strings for njs HTTP and stream objects.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2182
diff
changeset
|
31 модуле <link doc="../http/ngx_http_js_module.xml">ngx_http_js_module</link>. |
23cfb62121d1
Mentioned byte strings for njs HTTP and stream objects.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2182
diff
changeset
|
32 Все строки в объекте <literal>HTTP</literal> являются |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
33 <link id="string">байтовыми строками</link>. |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
34 |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
35 <list type="tag"> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
36 |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
37 <tag-name><literal>r.args{}</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
38 <tag-desc> |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
39 объект аргументов запроса, только чтение |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
40 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
41 |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
42 <tag-name><literal>r.error(<value>строка</value>)</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
43 <tag-desc> |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
44 записывает <literal>строку</literal> в лог-файл ошибок |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
45 на уровне лога <literal>error</literal> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
46 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
47 |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
48 <tag-name><literal>r.finish()</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
49 <tag-desc> |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
50 завершает отправку ответа клиенту |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
51 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
52 |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
53 <tag-name><literal>r.headersIn{}</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
54 <tag-desc> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
55 объект входящих заголовков, только чтение. |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
56 <para> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
57 Например, доступ к заголовку <literal>Foo</literal> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
58 можно получить при помощи синтаксиса <literal>headersIn.foo</literal> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
59 или <literal>headersIn['Foo']</literal> |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
60 </para> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
61 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
62 |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
63 <tag-name><literal>r.headersOut{}</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
64 <tag-desc> |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
65 объект исходящих заголовков, доступно для записи. |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
66 <para> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
67 Например, доступ к заголовку <literal>Foo</literal> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
68 можно получить при помощи синтаксиса <literal>headersOut.foo</literal> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
69 или <literal>headersOut['Foo']</literal> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
70 </para> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
71 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
72 |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
73 <tag-name><literal>r.httpVersion</literal></tag-name> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
74 <tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
75 версия HTTP, только чтение |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
76 </tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
77 |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
78 <tag-name><literal>r.log(<value>строка</value>)</literal></tag-name> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
79 <tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
80 записывает <literal>строку</literal> в лог-файл ошибок |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
81 на уровне лога <literal>info</literal> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
82 </tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
83 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
84 <tag-name id="r_internal_redirect"><literal>r.internalRedirect(<value>uri</value>)</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
85 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
86 осуществляет внутреннее перенаправление на указанный <literal>uri</literal>. |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
87 Если uri начинается с префикса “<literal>@</literal>”, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
88 то он считается именованным location. |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
89 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
90 |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
91 <tag-name><literal>r.method</literal></tag-name> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
92 <tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
93 HTTP метод, только чтение |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
94 </tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
95 |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
96 <tag-name><literal>r.parent</literal></tag-name> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
97 <tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
98 ссылается на родительский объект запроса |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
99 </tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
100 |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
101 <tag-name><literal>r.remoteAddress</literal></tag-name> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
102 <tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
103 адрес клиента, только чтение |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
104 </tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
105 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
106 <tag-name id="r_request_body"><literal>r.requestBody</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
107 <tag-desc> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
108 возвращает тело запроса клиента, если оно не было |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
109 записано во временный файл. |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
110 Чтобы убедиться, что тело запроса клиента находится в памяти, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
111 его размер должен быть ограничен |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
112 <link doc="../http/ngx_http_core_module.xml" id="client_max_body_size"/>, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
113 и также необходимо установить достаточный размер буфера при помощи |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
114 <link doc="../http/ngx_http_core_module.xml" id="client_body_buffer_size"/>. |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
115 </tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
116 |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
117 <tag-name><literal>r.responseBody</literal></tag-name> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
118 <tag-desc> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
119 хранит тело ответа <link id="subrequest">подзапроса</link>, только чтение. |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
120 Размер <literal>r.responseBody</literal> ограничивается директивой |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
121 <link doc="../http/ngx_http_core_module.xml" id="subrequest_output_buffer_size"/>. |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
122 </tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
123 |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
124 <tag-name><literal>r.return(код[, строка])</literal></tag-name> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
125 <tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
126 отправляет |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
127 клиенту полный ответ с указанным <literal>кодом</literal> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
128 <para> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
129 Можно задать или URL перенаправления |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
130 (для кодов 301, 302, 303, 307 и 308), |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
131 или текст тела ответа (для остальных кодов) в качестве второго аргумента |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
132 </para> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
133 </tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
134 |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
135 <tag-name><literal>r.send(<value>строка</value>)</literal></tag-name> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
136 <tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
137 отправляет часть тела ответа клиенту |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
138 </tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
139 |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
140 <tag-name><literal>r.sendHeader()</literal></tag-name> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
141 <tag-desc> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
142 отправляет заголовки HTTP клиенту |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
143 </tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
144 |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
145 <tag-name><literal>r.status</literal></tag-name> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
146 <tag-desc> |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
147 статус, доступно для записи |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
148 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
149 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
150 <tag-name><literal>r.variables{}</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
151 <tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
152 объект переменных nginx, только чтение |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
153 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
154 |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
155 <tag-name><literal>r.warn(<value>строка</value>)</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
156 <tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
157 записывает <literal>строку</literal> в лог-файл ошибок |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
158 на уровне лога <literal>warning</literal> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
159 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
160 |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
161 <tag-name><literal>r.uri</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
162 <tag-desc> |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
163 текущий URI, только чтение |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
164 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
165 |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
166 <tag-name id="subrequest"><literal>r.subrequest(<value>uri</value>[, |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
167 <value>options</value>[, <value>callback</value>]])</literal></tag-name> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
168 <tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
169 создаёт подзапрос с заданными <literal>uri</literal> и |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
170 <literal>options</literal> и устанавливает |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
171 необязательный <literal>callback</literal> завершения. |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
172 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
173 <para> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
174 Если <literal>options</literal> является строкой, то в ней |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
175 содержится срока аргументов подзапроса. |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
176 В противном случае ожидается, что <literal>options</literal> является |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
177 объектом со следующими ключами: |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
178 <list type="tag"> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
179 <tag-name><literal>args</literal></tag-name> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
180 <tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
181 строка с аргументами |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
182 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
183 <tag-name><literal>body</literal></tag-name> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
184 <tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
185 тело запроса |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
186 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
187 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
188 <tag-name><literal>method</literal></tag-name> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
189 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
190 метод HTTP |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
191 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
192 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
193 </list> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
194 </para> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
195 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
196 <para> |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
197 <literal>callback</literal> получает |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
198 объект ответа подзапроса с методами и свойствами, |
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
199 идентичными родительскому объекту запроса. |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
200 </para> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
201 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
202 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
203 </list> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
204 </para> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
205 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
206 </section> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
207 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
208 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
209 <section id="stream" name="Stream-сессия"> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
210 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
211 <para> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
212 Объект stream-сессии доступен только в |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
213 модуле |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
214 <link doc="../stream/ngx_stream_js_module.xml">ngx_stream_js_module</link>. |
2189
23cfb62121d1
Mentioned byte strings for njs HTTP and stream objects.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2182
diff
changeset
|
215 Все строки в объекте <literal>stream</literal> являются |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
216 <link id="string">байтовыми строками</link>. |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
217 </para> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
218 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
219 <para> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
220 <note> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
221 До версии njs <link doc="../njs/changes.xml" id="njs0.2.4">0.2.4</link>, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
222 у объекта stream-сессии были некоторые свойства, которые на данный момент |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
223 <link id="stream_obsolete">удалены</link>. |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
224 </note> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
225 </para> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
226 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
227 <para> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
228 <list type="tag"> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
229 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
230 <tag-name id="s_allow"><literal>s.allow()</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
231 <tag-desc> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
232 успешно финализирует обработчик фазы |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
233 (<link doc="../njs/changes.xml" id="njs0.2.4">0.2.4</link>) |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
234 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
235 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
236 <tag-name id="s_decline"><literal>s.decline()</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
237 <tag-desc> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
238 финализирует обработчик фазы и передаёт контроль следующему обработчику |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
239 (<link doc="../njs/changes.xml" id="njs0.2.4">0.2.4</link>) |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
240 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
241 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
242 <tag-name id="s_deny"><literal>s.deny()</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
243 <tag-desc> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
244 финализирует обработчик фазы с кодом ошибки доступа |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
245 (<link doc="../njs/changes.xml" id="njs0.2.4">0.2.4</link>) |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
246 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
247 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
248 <tag-name id="s_done"><literal>s.done</literal>(<value>[код]</value>)</tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
249 <tag-desc> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
250 успешно финализирует текущий обработчик фазы |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
251 или финализирует его с указанным числовым кодом |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
252 (<link doc="../njs/changes.xml" id="njs0.2.4">0.2.4</link>). |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
253 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
254 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
255 <tag-name><literal>s.error(<value>строка</value>)</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
256 <tag-desc> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
257 записывает отправленную <literal>строку</literal> в лог-файл ошибок |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
258 на уровне лога <literal>error</literal> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
259 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
260 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
261 <tag-name><literal>s.log(<value>строка</value>)</literal></tag-name> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
262 <tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
263 записывает отправленную <value>строку</value> в лог-файл ошибок |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
264 на уровне лога <literal>info</literal> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
265 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
266 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
267 <tag-name id="s_off"><literal>s.off(<value>имяСобытия</value>)</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
268 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
269 отменяет регистрацию callback'а, установленного методом |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
270 <link id="s_on">s.on()</link> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
271 (<link doc="../njs/changes.xml" id="njs0.2.4">0.2.4</link>) |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
272 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
273 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
274 <tag-name id="s_on"><literal>s.on(<value>событие</value>, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
275 <value>callback</value>)</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
276 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
277 регистрирует <literal>callback</literal> для указанного <literal>события</literal> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
278 (<link doc="../njs/changes.xml" id="njs0.2.4">0.2.4</link>). |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
279 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
280 <para> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
281 <literal>Событием</literal> может являться одна из следующих строк: |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
282 <list type="tag"> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
283 <tag-name><literal>upload</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
284 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
285 новые данные от клиента |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
286 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
287 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
288 <tag-name><literal>download</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
289 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
290 новые данные к клиенту |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
291 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
292 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
293 </list> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
294 </para> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
295 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
296 <para> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
297 Callback завершения имеет следующий прототип: |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
298 <literal>callback(данные, флаги)</literal>, где |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
299 <literal>данные</literal> являются строкой, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
300 <literal>флаги</literal> являются объектом |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
301 со следующими свойствами: |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
302 <list type="tag"> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
303 <tag-name id="s_on_callback_last"><literal>last</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
304 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
305 логическое свойство, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
306 true, если данные являются последним буфером. |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
307 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
308 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
309 </list> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
310 </para> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
311 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
312 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
313 <tag-name><literal>s.remoteAddress</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
314 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
315 адрес клиента, только чтение |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
316 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
317 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
318 <tag-name id="s_send"><literal>s.send(<value>данные</value>[, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
319 <value>параметры</value>])</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
320 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
321 отправляет данные клиенту |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
322 (<link doc="../njs/changes.xml" id="njs0.2.4">0.2.4</link>). |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
323 <literal>Параметры</literal> являются объектом, используемым |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
324 для переопределения флагов буфера nginx, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
325 полученных из буфера входных данных. |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
326 Флаги могут быть переопределены при помощи следующих флагов: |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
327 <para> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
328 <list type="tag"> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
329 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
330 <tag-name><literal>last</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
331 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
332 логическое свойство, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
333 true, если буфер является последним буфером |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
334 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
335 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
336 <tag-name><literal>flush</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
337 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
338 логическое свойство, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
339 true, если буфер должен иметь флаг <literal>flush</literal> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
340 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
341 </list> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
342 </para> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
343 Метод может быть вызван несколько раз в течение одного вызова callback'a. |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
344 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
345 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
346 <tag-name><literal>s.variables{}</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
347 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
348 объект переменных nginx, только чтение |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
349 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
350 |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
351 <tag-name><literal>s.warn(<value>строка</value>)</literal></tag-name> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
352 <tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
353 записывает отправленную <literal>строку</literal> в лог-файл ошибок |
2182
7865ca0da0ab
Merged HTTP request,response, and reply in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2175
diff
changeset
|
354 на уровне лога <literal>warning</literal> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
355 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
356 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
357 </list> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
358 </para> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
359 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
360 <section id="stream_obsolete" name="Устаревшие свойства"> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
361 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
362 <para> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
363 Данные свойства были удалены |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
364 в njs версии <link doc="../njs/changes.xml" id="njs0.2.4">0.2.4</link> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
365 и не имеют обратной совместимости с существующим кодом njs. |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
366 </para> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
367 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
368 <para> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
369 <list type="tag"> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
370 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
371 <tag-name id="s_abort"><literal>s.ABORT</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
372 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
373 код <literal>ABORT</literal> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
374 <note> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
375 Начиная с версии njs <link doc="../njs/changes.xml" id="njs0.2.4">0.2.4</link> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
376 необходимо использовать метод <link id="s_deny">s.deny()</link>. |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
377 </note> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
378 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
379 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
380 <tag-name><literal>s.AGAIN</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
381 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
382 код <literal>AGAIN</literal> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
383 <note> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
384 Начиная с версии njs <link doc="../njs/changes.xml" id="njs0.2.4">0.2.4</link> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
385 соответствующее поведение достигается, если не вызываются |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
386 <link id="s_allow">s.allow()</link>, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
387 <link id="s_deny">s.deny()</link>, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
388 <link id="s_decline">s.decline()</link>, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
389 <link id="s_done">s.done()</link> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
390 и callback зарегистрирован. |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
391 </note> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
392 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
393 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
394 <tag-name id="s_buffer"><literal>s.buffer</literal></tag-name> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
395 <tag-desc> |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
396 текущий буфер, доступен для записи |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
397 <note> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
398 Начиная с версии njs <link doc="../njs/changes.xml" id="njs0.2.4">0.2.4</link> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
399 для записи необходимо использовать метод <link id="s_send">s.send()</link>. |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
400 Для чтения текущий буфер доступен в качестве первого аргумента |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
401 callback'а <literal>event</literal>. |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
402 </note> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
403 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
404 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
405 <tag-name><literal>s.DECLINED</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
406 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
407 код <literal>DECLINED</literal> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
408 <note> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
409 Начиная с версии njs <link doc="../njs/changes.xml" id="njs0.2.4">0.2.4</link> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
410 необходимо использовать метод <link id="s_decline">s.decline()</link>. |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
411 </note> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
412 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
413 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
414 <tag-name><literal>s.eof</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
415 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
416 логическое свойство, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
417 true, если текущий буфер является последним буфером, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
418 только чтение |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
419 <note> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
420 Начиная с версии njs <link doc="../njs/changes.xml" id="njs0.2.4">0.2.4</link> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
421 необходимо использовать свойство <link id="s_on_callback_last">flags.last</link>. |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
422 </note> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
423 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
424 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
425 <tag-name><literal>s.ERROR</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
426 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
427 код <literal>ERROR</literal> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
428 <note> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
429 Начиная с версии njs <link doc="../njs/changes.xml" id="njs0.2.4">0.2.4</link> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
430 для сообщения об ошибке используется соответствующее исключение. |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
431 </note> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
432 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
433 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
434 <tag-name><literal>s.fromUpstream</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
435 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
436 логическое свойство, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
437 true, если текущий буфер является буфером от проксируемого сервера к клиенту, |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
438 только чтение |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
439 <note> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
440 Начиная с версии njs <link doc="../njs/changes.xml" id="njs0.2.4">0.2.4</link> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
441 необходимо использовать |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
442 соответствующее <link id="s_on">событие</link> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
443 (<literal>upload</literal> или <literal>download</literal>) |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
444 для обработки данных к клиенту или от клиента. |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
445 </note> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
446 </tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
447 |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
448 <tag-name id="s_ok"><literal>s.OK</literal></tag-name> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
449 <tag-desc> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
450 код <literal>OK</literal> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
451 <note> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
452 Начиная с версии njs <link doc="../njs/changes.xml" id="njs0.2.4">0.2.4</link> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
453 необходимо использовать метод <link id="s_allow">s.allow()</link>. |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
454 </note> |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
455 </tag-desc> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
456 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
457 </list> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
458 </para> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
459 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
460 </section> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
461 |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
462 </section> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
463 |
2295
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
464 </section> |
a1d0238ffb61
Updated HTTP and stream objects in Russian njs reference.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2290
diff
changeset
|
465 |
2316
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
466 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
467 <section id="core" name="Core"> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
468 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
469 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
470 <section id="string" name="Строка"> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
471 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
472 <para> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
473 В njs существует два типа строк: строка Unicode (по умолчанию) и |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
474 байтовая строка. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
475 </para> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
476 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
477 <para> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
478 Строка Unicode соответствует строке ECMAScript, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
479 содержащей символы Unicode. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
480 </para> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
481 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
482 <para> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
483 Байтовые строки содержат последовательность байт и |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
484 используются для сериализации строк Unicode |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
485 во внешние данные и десериализации из внешних источников. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
486 Например метод <link id="string_toutf8">toUTF8()</link> сериализует |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
487 строку Unicode в байтовую строку используя кодировку UTF8: |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
488 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
489 >> '£'.toUTF8().toString('hex') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
490 'c2a3' /* C2 A3 является UTF8-представлением codepoint 00A3 ('£') */ |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
491 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
492 Метод <link id="string_tobytes">toBytes()</link> сериализует |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
493 строку Unicode с codepoints до 255 в байтовую строку, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
494 в противном случае возвращается <literal>null</literal>: |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
495 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
496 >> '£'.toBytes().toString('hex') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
497 'a3' /* a3 является байтом, равным codepoint 00A3 ('£') */ |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
498 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
499 В различные кодировки могут быть преобразованы только байтовые строки. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
500 Например строка не может быть кодирована напрямую в <literal>hex</literal>: |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
501 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
502 >> 'αβγδ'.toString('base64') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
503 TypeError: argument must be a byte string |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
504 at String.prototype.toString (native) |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
505 at main (native) |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
506 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
507 Чтобы преобразовать строку Unicode в hex, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
508 сначала необходимо её преобразовать в байтовую строку и затем в hex: |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
509 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
510 >> 'αβγδ'.toUTF8().toString('base64') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
511 'zrHOss6zzrQ=' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
512 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
513 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
514 <list type="tag"> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
515 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
516 <tag-name id="string_bytesfrom"><literal>String.bytesFrom(<value>массив</value> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
517 | <value>строка</value>, <value>кодировка</value>)</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
518 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
519 (только в njs) Создаёт байтовую строку или из массива, содержащего октеты, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
520 или из кодированной строки |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
521 (<link doc="../njs/changes.xml" id="njs0.2.3">0.2.3</link>). |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
522 Кодировкой может быть |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
523 <literal>hex</literal>, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
524 <literal>base64</literal> и |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
525 <literal>base64url</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
526 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
527 >> String.bytesFrom([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]) |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
528 'buffer' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
529 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
530 >> String.bytesFrom('YnVmZmVy', 'base64') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
531 'buffer' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
532 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
533 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
534 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
535 <tag-name id="string_fromcharcode"><literal>String.fromCharCode(<value>CharCode1</value>[, ...[, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
536 <value>CharCodeN</value>]])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
537 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
538 Возвращает строку из одной или более Unicode codepoints. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
539 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
540 >> String.fromCharCode(97, 98, 99, 100) |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
541 'abcd' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
542 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
543 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
544 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
545 <tag-name id="string_fromcodepoint"><literal>String.fromCodePoint(<value>codePoint1</value>[, ...[, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
546 <value>codePoint2</value>]])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
547 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
548 Возвращает строку из одной или более Unicode codepoints. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
549 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
550 >> String.fromCodePoint(97, 98, 99, 100) |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
551 'abcd' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
552 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
553 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
554 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
555 <tag-name id="string_charat"><literal>String.prototype.charAt(<value>индекс</value>)</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
556 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
557 Возвращает строку, представляющую одну кодовую единицу Unicode |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
558 внутри указанного <literal>индекса</literal>; |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
559 пустая строка, если индекс вне диапазона значений. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
560 Индекс может быть числом |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
561 между 0 и длиной строки минус 1. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
562 Если индекс не указан, то значение по умолчанию равно <literal>0</literal>, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
563 т.е. возвращается первый символ в строке. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
564 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
565 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
566 <tag-name id="string_codepointat"><literal>String.prototype.CodePointAt(<value>позиция</value>)</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
567 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
568 Возвращает число, представляющее codepoint-значение символа |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
569 в пределах указанной <literal>позиции</literal>; |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
570 <literal>undefined</literal>, если элемент в позиции отсутствует. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
571 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
572 >> 'ABCD'.codePointAt(3); |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
573 68 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
574 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
575 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
576 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
577 <tag-name id="string_concat"><literal>String.prototype.concat(<value>строка1</value>[, ..., |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
578 <value>строкаN</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
579 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
580 Возвращает строку, содержающую результат объединения указанных |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
581 <literal>строк</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
582 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
583 >> "a".concat("b", "c") |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
584 'abc' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
585 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
586 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
587 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
588 <tag-name id="string_endswith"><literal>String.prototype.endsWith(<value>ПоисковаяСтрока</value>[, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
589 <value>длина</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
590 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
591 Возвращает <literal>true</literal>, если строка заканчивается символами |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
592 указанной строки, иначе <literal>false</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
593 Необязательный параметр <literal>длина</literal> задаёт длину строки. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
594 Если <value>ПоисковаяСтрока</value> не указана, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
595 значением по умолчанию является длина строки. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
596 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
597 >> 'abc'.endsWith('abc') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
598 true |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
599 >> 'abca'.endsWith('abc') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
600 false |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
601 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
602 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
603 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
604 <tag-name id="string_frombytes"><literal>String.prototype.fromBytes(<value>начало</value>[, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
605 <value>конец</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
606 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
607 (только в njs) Возвращает новую строку Unicode из байтовой строки, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
608 в которой каждый байт заменяется соответствующей Unicode codepoint. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
609 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
610 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
611 <tag-name id="string_fromutf8"><literal>String.prototype.fromUTF8(<value>начало</value>[, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
612 <value>конец</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
613 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
614 (только в njs) Преобразует байтовую строку, содержащую валидную строку UTF8, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
615 в строку Unicode, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
616 иначе возвращается <literal>null</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
617 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
618 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
619 <tag-name id="string_includes"><literal>String.prototype.includes(<value>поисковаяСтрока</value>[, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
620 <value>позиция</value>]))</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
621 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
622 Возвращает <literal>true</literal>, если строка ищется внутри другой строки, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
623 иначе <literal>false</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
624 Необязательный параметр <literal>позиция</literal> задаёт позицию |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
625 внутри строки, от которой начинается поиск для <literal>поисковойСтроки</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
626 Значение по умолчанию равно 0. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
627 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
628 >> 'abc'.includes('bc') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
629 true |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
630 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
631 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
632 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
633 <tag-name id="string_indexof"><literal>String.prototype.indexOf(<value>поисковаяСтрока</value>[, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
634 <value>fromIndex</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
635 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
636 Возвращает позицию первого появления |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
637 <literal>поисковойСтроки</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
638 Поиск начинается с <literal>fromIndex</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
639 Возвращает <value>-1</value>, если значение не найдено. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
640 <literal>fromIndex</literal> является числом, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
641 значение по умолчанию равно 0. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
642 Если <literal>fromIndex</literal> меньше, чем 0 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
643 или больше, чем |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
644 <link id="string_length">String.prototype.length</link><value></value>, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
645 поиск начнётся на индексе <value>0</value> и |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
646 <value>String.prototype.length</value>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
647 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
648 >> 'abcdef'.indexOf('de', 2) |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
649 3 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
650 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
651 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
652 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
653 <tag-name id="string_lastindexof"><literal>String.prototype.lastIndexOf(<value>поисковаяСтрока</value>[, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
654 <value>fromIndex</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
655 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
656 Возвращает позицию последнего появления |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
657 of the <literal>поисковойСтроки</literal>, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
658 поиск осуществляется в обратном порядке от <literal>fromIndex</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
659 Возвращает <value>-1</value>, если значение не найдено. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
660 Если значение <literal>поисковойСтроки</literal> пустое, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
661 то возвращается <literal>fromIndex</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
662 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
663 >> "nginx".lastIndexOf("gi") |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
664 1 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
665 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
666 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
667 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
668 <tag-name id="string_length"><literal>String.prototype.length</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
669 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
670 Возвращает длину строки. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
671 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
672 >> 'αβγδ'.length |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
673 4 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
674 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
675 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
676 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
677 <tag-name id="string_match"><literal>String.prototype.match([<value>регулярноеВыражение</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
678 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
679 Возвращает совпадение при сопоставлении строки с |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
680 регулярным выражением. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
681 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
682 >> 'nginx'.match( /ng/i ) |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
683 'ng' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
684 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
685 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
686 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
687 <tag-name id="string_padend"><literal>String.prototype.padEnd(<value>длина</value> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
688 [, <value>строка</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
689 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
690 Возвращает строку указанной длины, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
691 добавляя строку в конец указанной |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
692 строки (<link doc="../njs/changes.xml" id="njs0.2.3">0.2.3</link>). |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
693 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
694 >> '1234'.padEnd(8, 'abcd') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
695 '1234abcd' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
696 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
697 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
698 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
699 <tag-name id="string_padstart"><literal>String.prototype.padStart(<value>длина</value> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
700 [, <value>строка</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
701 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
702 Возвращает строку указанной длины, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
703 добавляя строку к началу указанной |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
704 строки (<link doc="../njs/changes.xml" id="njs0.2.3">0.2.3</link>). |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
705 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
706 >> '1234'.padStart(8, 'abcd') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
707 'abcd1234' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
708 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
709 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
710 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
711 <tag-name id="string_repeat"><literal>String.prototype.repeat(<value>число</value>)</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
712 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
713 Возвращает строку |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
714 с указанным числом копий строки. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
715 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
716 >> 'abc'.repeat(3) |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
717 'abcabcabc' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
718 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
719 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
720 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
721 <tag-name id="string_replace"><literal>String.prototype.replace([<value>регулярноеВыражение</value>|<value>string</value>[, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
722 <value>string</value>|<value>function</value>]])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
723 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
724 Возвращает новую строку, которая сопоставляется со |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
725 строкой или регулярным выражением, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
726 и заменяется на <literal>строку</literal> или <literal>функцию</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
727 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
728 >> 'abcdefgh'.replace('d', 1) |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
729 'abc1efgh' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
730 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
731 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
732 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
733 <tag-name id="string_search"><literal>String.prototype.search([<value>регулярноеВыражение</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
734 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
735 Осуществляет поиск строки при помощи регулярного выражения. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
736 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
737 >> 'abcdefgh'.search('def') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
738 3 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
739 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
740 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
741 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
742 <tag-name id="string_slice"><literal>String.prototype.slice(<value>начало</value>[, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
743 <value>конец</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
744 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
745 Возвращает новую строку, содержащую часть |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
746 исходной строки между <literal>началом</literal> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
747 и <literal>концом</literal> или |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
748 от <literal>начала</literal> до конца строки. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
749 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
750 >> 'abcdefghijklmno'.slice(NaN, 5) |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
751 'abcde' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
752 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
753 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
754 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
755 <tag-name id="string_split"><literal>String.prototype.split(([<value>строка</value>|<value>регулярноеВыражение</value>[, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
756 <value>лимит</value>]]))</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
757 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
758 Возвращает совпадение строки регулярному выражению. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
759 Необязательный параметр <literal>лимит</literal> является числом, задающим |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
760 ограничение на количество найденных подстрок. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
761 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
762 >> 'abc'.split('') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
763 [ |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
764 'a', |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
765 'b', |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
766 'c' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
767 ] |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
768 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
769 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
770 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
771 <tag-name id="string_startswith"><literal>String.prototype.startsWith(<value>поисковаяСтрока</value>[, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
772 <value>позиция</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
773 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
774 Возвращает <literal>true</literal>, если строка начинается с символов |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
775 указанной строки, иначе <literal>false</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
776 Необязательный параметр <literal>позиция</literal> является местом |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
777 в этой строке, с которого начинается поиск <literal>поисковойСтоки</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
778 Значение по умолчанию равно 0. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
779 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
780 >> 'abc'.startsWith('abc') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
781 true |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
782 > 'aabc'.startsWith('abc') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
783 false |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
784 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
785 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
786 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
787 <tag-name id="string_substr"><literal>String.prototype.substr(<value>начало</value>[, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
788 <value>длина</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
789 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
790 Возвращает часть строки указанной <literal>длины</literal> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
791 от <literal>начала</literal> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
792 или от <literal>начала</literal> до конца строки. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
793 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
794 >> 'abcdefghijklmno'.substr(3, 5) |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
795 'defgh' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
796 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
797 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
798 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
799 <tag-name id="string_substring"><literal>String.prototype.substring(<value>начало</value>[, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
800 <value>конец</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
801 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
802 Возвращает часть строки между |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
803 <literal>началом</literal> и <literal>концом</literal> или |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
804 от от <literal>начала</literal> до конца строки. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
805 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
806 >> 'abcdefghijklmno'.substring(3, 5) |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
807 'de' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
808 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
809 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
810 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
811 <tag-name id="string_tobytes"><literal>String.prototype.toBytes(начало[, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
812 конец])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
813 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
814 (только в njs) Сериализует строку Unicode в байтовую строку. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
815 Возвращает <literal>null</literal>, если в строке найден символ больше, чем 255. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
816 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
817 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
818 <tag-name id="string_tolowercase"><literal>String.prototype.toLowerCase()</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
819 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
820 Преобразует строку в нижний регистр. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
821 Метод поддерживает только простое свёртывание Unicode. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
822 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
823 >> 'ΑΒΓΔ'.toLowerCase() |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
824 'αβγδ' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
825 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
826 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
827 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
828 <tag-name><literal>String.prototype.toString([<value>кодировка</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
829 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
830 <para> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
831 Если кодировка не указана, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
832 возвращает указанную строку Unicode string или байтовую строку как в ECMAScript. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
833 </para> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
834 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
835 <para> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
836 (только в njs) Если кодировка указана, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
837 кодирует <link id="string_tobytes">байтовую строку</link> в |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
838 <literal>hex</literal>, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
839 <literal>base64</literal> или |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
840 <literal>base64url</literal>. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
841 </para> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
842 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
843 >> 'αβγδ'.toUTF8().toString('base64url') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
844 'zrHOss6zzrQ' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
845 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
846 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
847 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
848 <tag-name id="string_touppercase"><literal>String.prototype.toUpperCase()</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
849 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
850 Преобразует строку в верхний регистр. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
851 Метод поддерживает только простое свёртывание Unicode. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
852 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
853 >> 'αβγδ'.toUpperCase() |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
854 'ΑΒΓΔ' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
855 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
856 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
857 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
858 <tag-name id="string_toutf8"><literal>String.prototype.toUTF8(<value>начало</value>[, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
859 <value>конец</value>])</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
860 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
861 (только в njs) Сериализует строку Unicode |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
862 в байтовую строку при помощи кодирования UTF8. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
863 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
864 >> 'αβγδ'.toUTF8().length |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
865 8 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
866 >> 'αβγδ'.length |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
867 4 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
868 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
869 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
870 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
871 <tag-name id="string_trim"><literal>String.prototype.trim()</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
872 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
873 Удаляет пробелы в начале и конце строки. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
874 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
875 >> ' abc '.trim() |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
876 'abc' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
877 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
878 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
879 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
880 <tag-name id="encodeuri"><literal>encodeURI(<value>URI</value>)</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
881 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
882 Кодирует URI путём замены определённых символов |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
883 на одну, две, три или четыре последовательности, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
884 представляющие UTF-8 кодировку символа. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
885 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
886 >> encodeURI('012αβγδ') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
887 '012%CE%B1%CE%B2%CE%B3%CE%B4' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
888 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
889 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
890 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
891 <tag-name id="encodeuricomponent"><literal>encodeURIComponent(<value>encodedURIString</value>)</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
892 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
893 Кодирует URI путём замены определённых символов |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
894 на одну, две, три или четыре последовательности, |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
895 представляющие UTF-8 кодировку символа. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
896 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
897 >> encodeURIComponent('[@?=') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
898 '%5B%40%3F%3D' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
899 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
900 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
901 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
902 <tag-name id="decodeuri"><literal>decodeURI(<value>encodedURI</value>)</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
903 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
904 Декодирует ранее <link id="encodeuri">кодированный</link> URI. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
905 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
906 >> decodeURI('012%CE%B1%CE%B2%CE%B3%CE%B4') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
907 '012αβγδ' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
908 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
909 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
910 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
911 <tag-name id="decodeuricomponent"><literal>decodeURIComponent(<value>decodedURIString</value>)</literal></tag-name> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
912 <tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
913 Декодирует ранее <link id="encodeuri">кодированный</link> URI. |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
914 <example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
915 >> decodeURIComponent('%5B%40%3F%3D') |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
916 '[@?=' |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
917 </example> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
918 </tag-desc> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
919 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
920 </list> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
921 </para> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
922 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
923 </section> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
924 |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
925 </section> |
3a8d96efece6
Translated String object into Russian in njs.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2295
diff
changeset
|
926 |
2175
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
927 </article> |
cd4889fdcfa4
Moved njs HTTP and Stream API to a separate page.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
diff
changeset
|
928 |