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/migration-guides.md
+13-6
Original file line number
Diff line number
Diff line change
@@ -70,13 +70,16 @@ Readability is very important to us, so we have different names for these option
70
70
71
71
- The [`agent` option](2-options.md#agent) is now an object with `http`, `https` and `http2` properties.
72
72
- The [`timeout` option](6-timeout.md) is now an object. You can set timeouts on particular events!
73
-
- The [`searchParams` option](https://github.com/sindresorhus/got#searchParams) is always serialized using [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) unless it's a `string`.
74
-
- To use streams, call `got.stream(url, options)` or `got(url, {…, isStream: true}`).
73
+
- The [`searchParams` option](https://github.com/sindresorhus/got#searchParams) is always serialized using [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams).
74
+
- In order to pass a custom query string, provide it with the `url` option.\
- To use streams, call `got.stream(url, options)` or `got(url, {…, isStream: true})`.
75
78
76
79
#### Breaking changes
77
80
78
81
- The `json` option is not a `boolean`, it's an `object`. It will be stringified and used as a body.
79
-
- The `form` option is an `object` and will be used as `application/x-www-form-urlencoded` body
82
+
- The `form` option is an `object` and will be used as `application/x-www-form-urlencoded` body.
80
83
- All headers are converted to lowercase.\
81
84
According to [the spec](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2), the headers are case-insensitive.
82
85
- No `oauth` / `hawk` / `aws` / `httpSignature` option.\
@@ -86,9 +89,9 @@ Readability is very important to us, so we have different names for these option
86
89
You need to pass an agent with `keepAlive` option set to `true`.
87
90
- No `proxy` option. You need to [pass a custom agent](tips.md#proxy).
88
91
- No `auth` option.\
89
-
You need to use `username` / `password` instead or set the `authorization` header manually.
92
+
You need to use [`username`](2-options.md#username) / [`password`](2-options.md#password) instead or set the `authorization` header manually.
90
93
- No `baseUrl` option.\
91
-
Instead, there is `prefixUrl` which appends a trailing slash if not present.
94
+
Instead, there is [`prefixUrl`](2-options.md#prefixurl) which appends a trailing slash if not present.
92
95
- No `removeRefererHeader` option.\
93
96
You can remove the `referer` header in a [`beforeRequest` hook](hooks.md#beforerequest).
94
97
- No `followAllRedirects` option.
@@ -138,4 +141,8 @@ In terms of streams nothing has really changed.
138
141
139
142
#### You're good to go!
140
143
141
-
Well, you have already come this far :tada: Take a look at the [documentation](../readme.md#documentation). It's worth the time to read it. There are [some great tips](tips.md). If something is unclear or doesn't work as it should, don't hesitate to [open an issue](https://github.com/sindresorhus/got/issues/new/choose).
144
+
Well, you have already come this far :tada:\
145
+
Take a look at the [documentation](../readme.md#documentation). It's worth the time to read it.\
146
+
There are [some great tips](tips.md).
147
+
148
+
If something is unclear or doesn't work as it should, don't hesitate to [open an issue](https://github.com/sindresorhus/got/issues/new/choose).
Copy file name to clipboardExpand all lines: readme.md
+26
Original file line number
Diff line number
Diff line change
@@ -157,6 +157,32 @@ For advanced JSON usage, check out the [`parseJson`](2-options.md#parsejson) and
157
157
-[travis-got](https://github.com/samverschueren/travis-got) - Got convenience wrapper to interact with the Travis API
158
158
-[graphql-got](https://github.com/kevva/graphql-got) - Got convenience wrapper to interact with GraphQL
159
159
160
+
## Electron `net` module is not supported
161
+
162
+
Got doesn't support the `electron.net` module. It's missing crucial APIs that are available in Node.js. While Got used to support `electron.net`, it got very unstable and caused many errors.
163
+
164
+
However, you can use [IPC communication](https://www.electronjs.org/docs/api/ipc-main#ipcmainhandlechannel-listener) to get the Response object:
0 commit comments