From 5e843574fde6fda12f3db3d4fe864d324ff8bbfd Mon Sep 17 00:00:00 2001 From: MDN Date: Thu, 26 Aug 2021 00:43:36 +0000 Subject: [CRON] sync translated content --- files/zh-cn/_redirects.txt | 1 + files/zh-cn/_wikihistory.json | 12 +- .../conflicting/web/api/headers/get/index.html | 135 +++++++++++++++++++++ files/zh-cn/web/api/headers/getall/index.html | 134 -------------------- 4 files changed, 142 insertions(+), 140 deletions(-) create mode 100644 files/zh-cn/conflicting/web/api/headers/get/index.html delete mode 100644 files/zh-cn/web/api/headers/getall/index.html (limited to 'files') diff --git a/files/zh-cn/_redirects.txt b/files/zh-cn/_redirects.txt index 5653358610..f89f0c699c 100644 --- a/files/zh-cn/_redirects.txt +++ b/files/zh-cn/_redirects.txt @@ -1374,6 +1374,7 @@ /zh-CN/docs/Web/API/HTMLHyperlinkElementUtils/toString /zh-CN/docs/Web/API/HTMLAnchorElement/toString /zh-CN/docs/Web/API/HTMLHyperlinkElementUtils/username /zh-CN/docs/Web/API/HTMLAnchorElement/username /zh-CN/docs/Web/API/HTMLTableElement.deleteTHead /zh-CN/docs/Web/API/HTMLTableElement/deleteTHead +/zh-CN/docs/Web/API/Headers/getAll /zh-CN/docs/conflicting/Web/API/Headers/get /zh-CN/docs/Web/API/IDBCursor.direction /zh-CN/docs/Web/API/IDBCursor/direction /zh-CN/docs/Web/API/IDBFactory.open /zh-CN/docs/Web/API/IDBFactory/open /zh-CN/docs/Web/API/IDBObjectStore.openCursor /zh-CN/docs/Web/API/IDBObjectStore/openCursor diff --git a/files/zh-cn/_wikihistory.json b/files/zh-cn/_wikihistory.json index d2764ca101..5b8e48f2d8 100644 --- a/files/zh-cn/_wikihistory.json +++ b/files/zh-cn/_wikihistory.json @@ -15885,12 +15885,6 @@ "Taoja" ] }, - "Web/API/Headers/getAll": { - "modified": "2019-03-23T22:15:47.321Z", - "contributors": [ - "Taoja" - ] - }, "Web/API/Headers/has": { "modified": "2019-03-18T21:43:54.084Z", "contributors": [ @@ -47245,6 +47239,12 @@ "m2mbob" ] }, + "conflicting/Web/API/Headers/get": { + "modified": "2019-03-23T22:15:47.321Z", + "contributors": [ + "Taoja" + ] + }, "conflicting/Web/API/MouseEvent/altKey": { "modified": "2019-03-24T00:16:10.184Z", "contributors": [ diff --git a/files/zh-cn/conflicting/web/api/headers/get/index.html b/files/zh-cn/conflicting/web/api/headers/get/index.html new file mode 100644 index 0000000000..c4b5464f68 --- /dev/null +++ b/files/zh-cn/conflicting/web/api/headers/get/index.html @@ -0,0 +1,135 @@ +--- +title: Headers.getAll() +slug: conflicting/Web/API/Headers/get +translation_of: Web/API/Headers/getAll +original_slug: Web/API/Headers/getAll +--- +

{{APIRef("Fetch")}}{{ SeeCompatTable() }}

+ +

getAll() 方法会以数组形式返回指定header的所有值. 如果指定的header未存在,则返回一个空数组.

+ +
+

Note:出于安全原因, 部分头信息只能被用户代理控制. 这些头信息包括 {{Glossary("Forbidden_header_name", "forbidden header names", 1)}}  和 {{Glossary("Forbidden_response_header_name", "forbidden response header names", 1)}}.

+
+ +

Syntax

+ +
myHeaders.getAll(name);
+ +

Parameters

+ +
+
name
+
需检索的HTTP header名称. 如果HTTP header中不存在指定名称则抛出一个 {{jsxref("TypeError")}}.
+
+ +

Returns

+ +

An {{domxref("Array")}} containing a {{domxref("ByteString")}} sequence representing the values of the retrieved header.

+ +

Example

+ +

Creating an empty Headers object is simple:

+ +
var myHeaders = new Headers(); // Currently empty
+ +

You could add a header to this using {{domxref("Headers.append")}}, then retrieve it using getAll():

+ +
myHeaders.append('Content-Type', 'image/jpeg');
+myHeaders.getAll('Content-Type'); // Returns [ "image/jpeg" ]
+
+ +

If the header has multiple values associated with it, the array will contain all the values, in the order they were added to the Headers object:

+ +
myHeaders.append('Accept-Encoding', 'deflate');
+myHeaders.append('Accept-Encoding', 'gzip');
+myHeaders.getAll('Accept-Encoding'); // Returns [ "deflate", "gzip" ]
+ +
+

Note: Use {{domxref("Headers.get")}} to return only the first value added to the Headers object.

+
+ +

Specifications

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Fetch','#dom-headers-getall','getAll()')}}{{Spec2('Fetch')}} 
+ +

Browser compatibility

+ +

{{ CompatibilityTable() }}

+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support{{ CompatChrome(42) }}
+ {{ CompatChrome(41) }} behind pref
+  
{{ CompatGeckoDesktop(39)}}
+ 34 behind pref
{{ CompatNo }} +

29
+ 28 behind pref

+
{{ CompatNo }}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidFirefox Mobile (Gecko)Firefox OS (Gecko)IE PhoneOpera MobileSafari MobileChrome for Android
Basic support{{ CompatNo }}{{ CompatNo }}{{ CompatNo }}{{ CompatNo }}{{ CompatNo }}{{ CompatNo }}{{ CompatNo }}
+
+ +

See also

+ + diff --git a/files/zh-cn/web/api/headers/getall/index.html b/files/zh-cn/web/api/headers/getall/index.html deleted file mode 100644 index a9a2d22e59..0000000000 --- a/files/zh-cn/web/api/headers/getall/index.html +++ /dev/null @@ -1,134 +0,0 @@ ---- -title: Headers.getAll() -slug: Web/API/Headers/getAll -translation_of: Web/API/Headers/getAll ---- -

{{APIRef("Fetch")}}{{ SeeCompatTable() }}

- -

getAll() 方法会以数组形式返回指定header的所有值. 如果指定的header未存在,则返回一个空数组.

- -
-

Note:出于安全原因, 部分头信息只能被用户代理控制. 这些头信息包括 {{Glossary("Forbidden_header_name", "forbidden header names", 1)}}  和 {{Glossary("Forbidden_response_header_name", "forbidden response header names", 1)}}.

-
- -

Syntax

- -
myHeaders.getAll(name);
- -

Parameters

- -
-
name
-
需检索的HTTP header名称. 如果HTTP header中不存在指定名称则抛出一个 {{jsxref("TypeError")}}.
-
- -

Returns

- -

An {{domxref("Array")}} containing a {{domxref("ByteString")}} sequence representing the values of the retrieved header.

- -

Example

- -

Creating an empty Headers object is simple:

- -
var myHeaders = new Headers(); // Currently empty
- -

You could add a header to this using {{domxref("Headers.append")}}, then retrieve it using getAll():

- -
myHeaders.append('Content-Type', 'image/jpeg');
-myHeaders.getAll('Content-Type'); // Returns [ "image/jpeg" ]
-
- -

If the header has multiple values associated with it, the array will contain all the values, in the order they were added to the Headers object:

- -
myHeaders.append('Accept-Encoding', 'deflate');
-myHeaders.append('Accept-Encoding', 'gzip');
-myHeaders.getAll('Accept-Encoding'); // Returns [ "deflate", "gzip" ]
- -
-

Note: Use {{domxref("Headers.get")}} to return only the first value added to the Headers object.

-
- -

Specifications

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('Fetch','#dom-headers-getall','getAll()')}}{{Spec2('Fetch')}} 
- -

Browser compatibility

- -

{{ CompatibilityTable() }}

- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support{{ CompatChrome(42) }}
- {{ CompatChrome(41) }} behind pref
-  
{{ CompatGeckoDesktop(39)}}
- 34 behind pref
{{ CompatNo }} -

29
- 28 behind pref

-
{{ CompatNo }}
-
- -
- - - - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidFirefox Mobile (Gecko)Firefox OS (Gecko)IE PhoneOpera MobileSafari MobileChrome for Android
Basic support{{ CompatNo }}{{ CompatNo }}{{ CompatNo }}{{ CompatNo }}{{ CompatNo }}{{ CompatNo }}{{ CompatNo }}
-
- -

See also

- - -- cgit v1.2.3-54-g00ecf