-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: should not throw when fetch a Request with post (#563)
## 现象 使用 post method fetch 一个 Request 对象时会出现 `Cannot construct a Request with a Request object that has already been used.` 错误。 ## 原因 Request 的 constructor 会把入参的 request.body.stream.locked 变为 true,urllib 的 fetch 中已经使用参数 input new 了一个 Request,再调用 undici fetch 时参数还是 input,就会报错。 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Updated the fetch method to utilize a `Request` object for improved request handling. - Added a new test case to verify POST request functionality using the `Request` class. - **Chores** - Updated `.gitignore` to exclude the `.idea/` directory. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
- Loading branch information
Showing
3 changed files
with
13 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,4 @@ test/fixtures/ts-cjs-es2021/*.js | |
test/fixtures/ts-esm/*.js | ||
.eslintcache | ||
.tshy* | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters