@jayfong/x-request 2.76.2 → 2.78.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/_cjs/index.js CHANGED
@@ -103,6 +103,9 @@ class XRequest {
103
103
  if (options.followRedirect != null) {
104
104
  gotOptions.followRedirect = options.followRedirect;
105
105
  }
106
+ if (options.followRedirectWithMethod != null) {
107
+ gotOptions.methodRewriting = options.followRedirectWithMethod;
108
+ }
106
109
  if (options.timeoutMs) {
107
110
  gotOptions.timeout = options.timeoutMs;
108
111
  }
package/lib/index.d.ts CHANGED
@@ -52,6 +52,12 @@ export interface XRequestOptions {
52
52
  * @default true
53
53
  */
54
54
  followRedirect?: boolean;
55
+ /**
56
+ * 是否用同样的方法跟随跳转
57
+ *
58
+ * @default true
59
+ */
60
+ followRedirectWithMethod?: boolean;
55
61
  /**
56
62
  * COOKIE 容器
57
63
  */
package/lib/index.js CHANGED
@@ -94,6 +94,9 @@ export class XRequest {
94
94
  if (options.followRedirect != null) {
95
95
  gotOptions.followRedirect = options.followRedirect;
96
96
  }
97
+ if (options.followRedirectWithMethod != null) {
98
+ gotOptions.methodRewriting = options.followRedirectWithMethod;
99
+ }
97
100
  if (options.timeoutMs) {
98
101
  gotOptions.timeout = options.timeoutMs;
99
102
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jayfong/x-request",
3
- "version": "2.76.2",
3
+ "version": "2.78.0",
4
4
  "license": "ISC",
5
5
  "sideEffects": false,
6
6
  "main": "lib/_cjs/index.js",