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: 5-network/07-url/article.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,7 +65,7 @@ Here's the cheatsheet for URL components:
65
65
```smart header="We can pass `URL` objects to networking (and most other) methods instead of a string"
66
66
We can use a `URL` object in `fetch` or `XMLHttpRequest`, almost everywhere where a URL-string is expected.
67
67
68
-
Generally, `URL` object can be passed to any method instead of a string, as most method will perform the string conversion, that turns a `URL` object into a string with full URL.
68
+
Generally, the `URL` object can be passed to any method instead of a string, as most methods will perform the string conversion, that turns a `URL` object into a string with full URL.
69
69
```
70
70
71
71
## SearchParams "?..."
@@ -80,7 +80,7 @@ new URL('https://google.com/search?query=JavaScript')
80
80
81
81
...But parameters need to be encoded if they contain spaces, non-latin letters, etc (more about that below).
82
82
83
-
So there's URL property for that: `url.searchParams`, an object of type [URLSearchParams](https://url.spec.whatwg.org/#urlsearchparams).
83
+
So there's a URL property for that: `url.searchParams`, an object of type [URLSearchParams](https://url.spec.whatwg.org/#urlsearchparams).
84
84
85
85
It provides convenient methods for search parameters:
86
86
@@ -201,7 +201,7 @@ So we should use only `encodeURIComponent` for each search parameter, to correct
201
201
````smart header="Encoding difference compared to `URL`"
202
202
Classes [URL](https://url.spec.whatwg.org/#url-class) and [URLSearchParams](https://url.spec.whatwg.org/#interface-urlsearchparams) are based on the latest URI specification: [RFC3986](https://tools.ietf.org/html/rfc3986), while `encode*` functions are based on the obsolete version [RFC2396](https://www.ietf.org/rfc/rfc2396.txt).
203
203
204
-
There are few differences, e.g. IPv6 addresses are encoded differently:
204
+
There are a few differences, e.g. IPv6 addresses are encoded differently:
0 commit comments