[whatwg/fetch] Question - Why can't the request be cloned? (#939)

Given:

```
const request = new Request(someUri,
{
 method: "POST",
 headers: someHeaders,
 body: JSON.stringify({
  name: "name",
                parent: null
 })
});

const copyOfRequest = request.clone();
console.log("original: " + await request.text());
console.log("copy: " + await copyOfRequest.text());
```

The second log statement fails with `TypeError: Failed to execute 'text' on 'Request': body stream is locked` on `Version 77.0.3865.90 (Official Build) (64-bit)`.

Is this behavior by design?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/939

Received on Sunday, 22 September 2019 04:52:02 UTC