Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Produce valid output when showing/copying as code #857

Merged
merged 4 commits into from
May 11, 2020
Merged

Produce valid output when showing/copying as code #857

merged 4 commits into from
May 11, 2020

Conversation

Hydrophobefireman
Copy link
Contributor

No description provided.

Currently when copying a json request as fetch, it outputs a javascript object instead of a stringified version, which is not valid for a fetch request.
@TravisBuddy
Copy link

Hey @Hydrophobefireman,
Your changes look good to me!

View build log

TravisBuddy Request Identifier: 448955e0-92d2-11ea-84cf-61c3ab5f248b

@TravisBuddy
Copy link

Hey @Hydrophobefireman,
Your changes look good to me!

View build log

TravisBuddy Request Identifier: 336ac280-92d7-11ea-84cf-61c3ab5f248b

@liyasthomas
Copy link
Member

@Hydrophobefireman may I know what is the intended behavior/enhancement of this PR?

@Hydrophobefireman
Copy link
Contributor Author

@Hydrophobefireman may I know what is the intended behavior/enhancement of this PR?

Currently, when using the show code option for post requests (either contentType:application/json or urlencoded forms) postwoman outputs a javascript object, but fetch requires strings

copy-code

which shows up like this:
network-log

this pr adds a JSON.stringify to fix that and adds quotes around a urlencoded form.

@TravisBuddy
Copy link

Hey @Hydrophobefireman,
Your changes look good to me!

View build log

TravisBuddy Request Identifier: 4dbb9030-9361-11ea-84cf-61c3ab5f248b

@liyasthomas liyasthomas merged commit 5c31cf5 into hoppscotch:master May 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants