-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add form data handler in the sdk middleware module
- Loading branch information
1 parent
f02f7cf
commit 4f6b4fc
Showing
5 changed files
with
107 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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
"@vue-storefront/sdk": minor | ||
--- | ||
|
||
**[ADDED]** Add support for multipart/form-data requests in SDK | ||
|
||
- Added handling for multipart/form-data content type in the default HTTP client | ||
- Automatically handles File and Blob objects in request parameters | ||
|
||
```typescript | ||
// Upload a file using multipart/form-data | ||
await sdk.commerce.uploadFile( | ||
{ file: new File(["content"], "test.txt", { type: "text/plain" }) }, | ||
prepareConfig({ | ||
headers: { | ||
"Content-Type": "multipart/form-data", | ||
}, | ||
}) | ||
); | ||
``` |
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
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