postman-code-generators icon indicating copy to clipboard operation
postman-code-generators copied to clipboard

(Issue) When i use request.body it generates an error with JSON.parse()

Open mvargaslandolfi1993 opened this issue 3 years ago • 2 comments

Describe the bug When i use body.request it generates an error with JSON.parse().

To Reproduce let obj = { mode:'raw', raw: JSON.stringify(payload) } request.body = JSON.stringify(obj)

Screenshots error error

FIX The problem is fixed Changing the method toJSON () with JSON.parse ()

mvargaslandolfi1993 avatar Jan 04 '21 22:01 mvargaslandolfi1993

@mvargaslandolfi1993 Can you please give a screenshot of the Postman Request for which you're trying to generate code, as well the language/framework in which the problem is occuring?

webholik avatar Jan 20 '21 14:01 webholik

issue Im using JS and Jquery, and I'm trying to generate code in cURL, PHP (HTTP_Request2), Python(http.client), GO(Native) and Java(Unirest)

mvargaslandolfi1993 avatar Jan 21 '21 14:01 mvargaslandolfi1993