Skip to content

Commit 5c84f8e

Browse files
authored
Merge pull request #43 from REST-API-Client/fix/postRawDataBug
[2022/08/03] - Fix POST body raw data converted to JSON string before sending to server
2 parents 020367f + 1e0623f commit 5c84f8e

File tree

5 files changed

+15
-3
lines changed

5 files changed

+15
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 1.0.4
4+
5+
#### Fix POST body being converted to JSON string before sending to server
6+
37
## 1.0.3
48

59
#### Fix response header menu not displaying the whole header information

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"displayName": "REST API Client",
55
"icon": "icons/images/icon.png",
66
"description": "Simple and intuitive API Client made into a VSCode extension.",
7-
"version": "1.0.3",
7+
"version": "1.0.4",
88
"license": "MIT",
99
"bugs": {
1010
"url": "https://github.com/REST-API-Client/API-Client-VSCode-Extension/issues"

src/MainWebViewPanel.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,13 @@ class MainWebViewPanel {
183183
</head>
184184
<body>
185185
<div id="root"></div>
186+
<script nonce="${nonce}">
187+
let vscode;
188+
189+
if (typeof acquireVsCodeApi !== "undefined") {
190+
vscode = acquireVsCodeApi();
191+
}
192+
</script>
186193
<script src="${scriptSrc}" nonce="${nonce}"></script>
187194
</body>
188195
</html>`;

src/utils/getBody.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ import { TYPE } from "../constants";
44

55
function getBody(keyValueData, bodyOption, bodyRawOption, bodyRawData) {
66
if (bodyOption === "None") return;
7+
78
if (bodyOption === TYPE.BODY_RAW)
8-
return JSON.stringify(bodyRawData[bodyRawOption.toLowerCase()]);
9+
return bodyRawData[bodyRawOption.toLowerCase()];
910

1011
if (bodyOption === TYPE.BODY_FORM_DATA) {
1112
const formData = new FormData();

0 commit comments

Comments
 (0)