You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/10-instances.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ The options used for this instance.
20
20
(options:Options, next: …) =>next(options)
21
21
```
22
22
23
-
An array of handlers. The `next`funtion returns a [`Promise`](1-promise.md) or a [`Request` Got stream](3-streams.md).
23
+
An array of handlers. The `next`function returns a [`Promise`](1-promise.md) or a [`Request` Got stream](3-streams.md).
24
24
25
25
You execute them directly by calling `got(…)`. They are some sort of "global hooks" - these functions are called first. The last handler (it's invisible) is either `asPromise` or `asStream`, depending on the `options.isStream` property.
26
26
@@ -29,7 +29,7 @@ You execute them directly by calling `got(…)`. They are some sort of "global h
29
29
**Type: `boolean`**\
30
30
**Default: `false`**
31
31
32
-
Determines if`got.defaults.options` can be modified.
32
+
Determines whether`got.defaults.options` can be modified.
Copy file name to clipboardExpand all lines: documentation/2-options.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ It is made of getters and setters that provide fast option normalization and val
10
10
#### Merge behavior explained
11
11
12
12
When an option is already set, setting it again replaces it with a deep clone by default.\
13
-
Otherwise the merge behavior is documented in the correspoding section for the option.
13
+
Otherwise the merge behavior is documented in the corresponding section for the option.
14
14
15
15
#### How to store options
16
16
@@ -60,7 +60,7 @@ In the second example, it would throw only when the promise is being executed.
60
60
For TypeScript users, `got` exports a dedicated type called `OptionsInit`.\
61
61
It is a plain object that can store the same properties as `Options`.
62
62
63
-
Performance-wise there is no difference which one is used, although the construtor may be prefferred as it automatically validates the data.\
63
+
Performance-wise there is no difference which one is used, although the constructor may be preferred as it automatically validates the data.\
64
64
The `Options` approach may give a slight boost as it only clones the options, there is no normalization going on.\
65
65
It is also useful for storing the base configuration of a custom Got client.
66
66
@@ -585,7 +585,7 @@ See [ToughCookie API](https://github.com/salesforce/tough-cookie#getcookiestring
585
585
**Default: `false`**
586
586
587
587
Ignore invalid cookies instead of throwing an error.\
588
-
Only useful when the cookieJar option has been set.
588
+
Only useful when the `cookieJar` option has been set.
589
589
590
590
#### **Note:**
591
591
> - This is not recommended! Use at your own risk.
@@ -599,7 +599,7 @@ Defines if redirect responses should be followed automatically.
599
599
600
600
#### **Note:**
601
601
> - If a `303` is sent by the server in response to any request type (POST, DELETE, etc.), Got will automatically request the resource pointed to in the location header via GET.\
602
-
> This is in accordance with [the spec](https://tools.ietf.org/html/rfc7231#section-6.4.4).
602
+
> This is in accordance with the [specification](https://tools.ietf.org/html/rfc7231#section-6.4.4).
603
603
604
604
```js
605
605
importgotfrom'got';
@@ -673,7 +673,7 @@ Useful when making lots of requests to different public hostnames.
673
673
**Type: `4 | 6`**\
674
674
**Default: `undefined`**
675
675
676
-
The IP version to use. Choosing`undefined` will use the default configuration.
676
+
The IP version to use. Specifying`undefined` will use the default configuration.
> - The option has been renamed from the [`ca` TLS option](https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options) for better readability.
Called with plain request options, right before their normalization.\
20
+
Called with the plain request options, right before their normalization.\
21
21
The second argument represents the current [`Options`](2-options.md) instance.
22
22
23
23
**Note:**
24
-
> - This is called every time options get merged.
24
+
> - This is called every time options are merged.
25
25
26
26
**Note:**
27
27
> - This hook is called when a new instance of `Options` is created.
@@ -32,7 +32,7 @@ The second argument represents the current [`Options`](2-options.md) instance.
32
32
33
33
This is especially useful in conjunction with `got.extend()` when the input needs custom handling.
34
34
35
-
For example this can be used to fix typos to migrate from older versions faster.
35
+
For example, this can be used to fix typos to migrate from older versions faster.
36
36
37
37
```js
38
38
importgotfrom'got';
@@ -111,7 +111,7 @@ This hook is especially useful in conjunction with `got.extend()` when you want
111
111
> - Got will make no further changes to the request before it is sent.
112
112
113
113
**Note:**
114
-
> - Changing `options.json` or `options.form` has no effect on the request, you should change `options.body` instead. If needed, update the `options.headers` accordingly.
114
+
> - Changing `options.json` or `options.form` has no effect on the request. You should change `options.body` instead. If needed, update the `options.headers` accordingly.
> - You can indirectly override the `request` function by early returning a [`ClientRequest`-like](https://nodejs.org/api/http.html#http_class_http_clientrequest) instance or a [`IncomingMessage`-like](https://nodejs.org/api/http.html#http_class_http_incomingmessage) instance. This is very useful when creating a custom cache mechanism.
137
-
> -[Read more about this tip](https://github.com/sindresorhus/got/blob/docs-v12/documentation/cache.md#advanced-caching-mechanisms).
137
+
> -[Read more about this tip](cache.md#advanced-caching-mechanisms).
Got uses [Keyv](https://github.com/lukechilds/keyv) internally to support a wide range of storage adapters. For something more scalable you could use an [official Keyv storage adapter](https://github.com/lukechilds/keyv#official-storage-adapters):
0 commit comments