keq 2.3.0 → 2.3.2

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/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [2.3.2](https://github.com/keq-request/keq/compare/v2.3.1...v2.3.2) (2024-04-23)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * cannot send form-data when invoke .attach() first ([0195ee2](https://github.com/keq-request/keq/commit/0195ee2dcb4e43a58185f4c032d29fb6c00ac70d))
11
+
12
+ ## [2.3.1](https://github.com/keq-request/keq/compare/v2.3.0...v2.3.1) (2024-03-22)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * unabled send formDate request with buffer file ([9db1508](https://github.com/keq-request/keq/commit/9db1508c3366a5dd264e3de87bd8afef777f761f))
18
+
5
19
  ## [2.3.0](https://github.com/keq-request/keq/compare/v2.2.0...v2.3.0) (2024-02-24)
6
20
 
7
21
 
@@ -151,13 +151,15 @@ export class Keq extends Core {
151
151
  file = value;
152
152
  }
153
153
  else if (value instanceof Buffer) {
154
- file = new File([value], arg3);
154
+ const formData = new FormData();
155
+ formData.set(key, new Blob([value]), arg3);
156
+ file = formData.get(key);
155
157
  }
156
158
  else {
157
159
  throw new InvalidArgumentsExceptions();
158
160
  }
159
161
  this.requestContext.body = assignKeqRequestBody(this.requestContext.body, { [key]: file });
160
- this.setTypeIfEmpty('form-dat');
162
+ this.setTypeIfEmpty('form-data');
161
163
  return this;
162
164
  }
163
165
  /**
@@ -163,13 +163,15 @@
163
163
  file = value;
164
164
  }
165
165
  else if (value instanceof Buffer) {
166
- file = new File([value], arg3);
166
+ const formData = new FormData();
167
+ formData.set(key, new Blob([value]), arg3);
168
+ file = formData.get(key);
167
169
  }
168
170
  else {
169
171
  throw new invalid_arguments_exception_1.InvalidArgumentsExceptions();
170
172
  }
171
173
  this.requestContext.body = (0, assign_keq_request_body_1.assignKeqRequestBody)(this.requestContext.body, { [key]: file });
172
- this.setTypeIfEmpty('form-dat');
174
+ this.setTypeIfEmpty('form-data');
173
175
  return this;
174
176
  }
175
177
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keq",
3
- "version": "2.3.0",
3
+ "version": "2.3.2",
4
4
  "description": "Request API write by Typescript for flexibility, readability, and a low learning curve.",
5
5
  "keywords": [
6
6
  "request",