Skip to content

Commit ac984b9

Browse files
authored
Translation, First part
1 parent 98aa9a6 commit ac984b9

1 file changed

Lines changed: 16 additions & 17 deletions

File tree

5-network/05-fetch-api/article.md

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,45 @@
11

22
# Fetch API
33

4-
So far, we know quite a bit about fetch.
4+
До сих пор мы узнали лишь немного про `fetch`.
55

6-
Now let's see the rest of API, to cover all its abilities.
6+
Теперь давайте рассмотрим оставшуюся часть API, чтобы охватить все его возможности.
77

8-
Here's the full list of all possible fetch options with their default values (alternatives in comments):
8+
Вот полный перечень всех возможных параметров с их значениями по умолчанию (альтернативные значения в комментариях):
99

1010
```js
1111
let promise = fetch(url, {
12-
method: "GET", // POST, PUT, DELETE, etc.
12+
method: "GET", // POST, PUT, DELETE, и т.д.
1313
headers: {
14-
"Content-Type": "text/plain;charset=UTF-8" // for a string body, depends on body
14+
"Content-Type": "text/plain;charset=UTF-8" // для строкового тела, зависит от тела сообщения
1515
},
16-
body: undefined // string, FormData, Blob, BufferSource, or URLSearchParams
17-
referrer: "about:client", // "" for no-referrer, or an url from the current origin
16+
body: undefined // строка, FormData, Blob, BufferSource, или URLSearchParams
17+
referrer: "about:client", // "" для no-referrer, или URL-адрес текущего источника
1818
referrerPolicy: "no-referrer-when-downgrade", // no-referrer, origin, same-origin...
1919
mode: "cors", // same-origin, no-cors
2020
credentials: "same-origin", // omit, include
21-
cache: "default", // no-store, reload, no-cache, force-cache, or only-if-cached
21+
cache: "default", // no-store, reload, no-cache, force-cache, или only-if-cached
2222
redirect: "follow", // manual, error
23-
integrity: "", // a hash, like "sha256-abcdef1234567890"
23+
integrity: "", // хеш, например "sha256-abcdef1234567890"
2424
keepalive: false, // true
25-
signal: undefined, // AbortController to abort request
25+
signal: undefined, // AbortController для отмены запроса
2626
window: window // null
2727
});
2828
```
2929

30-
An impressive list, right?
30+
Впечатляющий список, верно?
3131

32-
We fully covered `method`, `headers` and `body` in the chapter <info:fetch-basics>.
32+
Мы полностью рассмотрели `method`, `headers` и `body` в главе <info:fetch-basics>.
3333

34-
The `signal` option is covered in <info:fetch-abort>.
34+
Параметр `signal` рассматривается в <info:fetch-abort>.
3535

36-
Now let's explore the rest of options.
36+
Теперь давайте разберем оставшиеся параметры.
3737

3838
## referrer, referrerPolicy
3939

40-
These options govern how `fetch` sets HTTP `Referer` header.
40+
Эти параметры определяют как `fetch` устанавливает HTTP-заголовок `Referer`.
4141

42-
That header contains the url of the page that made the request. In most scenarios, it plays a very minor informational role, but sometimes, for security purposes, it makes sense to remove or modify it.
43-
.
42+
Этот заголовок содержит URL-адрес страницы, которая сделала запрос. В большинстве случаев, это играет очень незначительную информационную роль, но иногда, в целях безопасности, имеет смысл изменить или удалить его.
4443

4544
**The `referrer` option allows to set any `Referer` within the current origin) or disable it.**
4645

0 commit comments

Comments
 (0)