Skip to content

Commit f87737e

Browse files
committed
move JSON.stringify to python helper
1 parent 13fe580 commit f87737e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/targets/python/helpers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ module.exports = {
7777
if (value === null || value === undefined) {
7878
return ''
7979
}
80-
return '"' + value.toString().replace(/"/g, '\\"') + '"'
80+
return JSON.stringify(value)
8181
}
8282
}
8383
}

src/targets/python/requests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ module.exports = function (source, options) {
5656
switch (source.postData.mimeType) {
5757
case 'application/json':
5858
if (source.postData.jsonObj) {
59-
code.push('payload = %s', JSON.stringify(source.postData.jsonObj))
59+
code.push('payload = %s', helpers.literalRepresentation(source.postData.jsonObj, opts))
6060
jsonPayload = true
6161
hasPayload = true
6262
}

0 commit comments

Comments
 (0)