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
The **`clone()`** method of the `Request` interface creates a copy of the current `Request` object.
10
+
11
+
Like the underlying `ReadableStream.tee`` api, the `body` of a cloned `Response`
12
+
will signal backpressure at the rate of the _faster_ consumer of the two bodies,
13
+
and unread data is enqueued internally on the slower consumed `body`
14
+
without any limit or backpressure.
15
+
Beware when you construct a `Request` from a stream and then `clone` it.
16
+
17
+
`clone()` throws a `TypeError` if the request body has already been used. In fact, the main reason `clone()` exists is to allow multiple uses of body objects (when they are one-use only.)
18
+
19
+
If you intend to modify the request, you may prefer the `Request` constructor.
20
+
21
+
## Syntax
22
+
23
+
```js
24
+
clone()
25
+
```
26
+
27
+
### Parameters
28
+
29
+
None.
30
+
31
+
### Return value
32
+
33
+
A `Request` object, which is an exact copy of the `Request` that `clone()` was called on.
0 commit comments