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

Import > Paste Raw Text cURL --data-raw not import to bodyraw #7895

Closed
wrssmi opened this issue Jan 9, 2020 · 31 comments · Fixed by #8296
Closed

Import > Paste Raw Text cURL --data-raw not import to bodyraw #7895

wrssmi opened this issue Jan 9, 2020 · 31 comments · Fixed by #8296

Comments

@wrssmi
Copy link

wrssmi commented Jan 9, 2020

Body - raw not filled with data after import

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Import > Paste Raw Text cURL'
  2. Use following curl
    curl --location --request POST "https://sample.com" --header "Content-Type: application/json" --data-raw "{ \"details\": { \"id\": \"11\", \"sample\": { \"name\": \"ankit\" } } }"
  3. Body is not filled (see Screenshot)

Expected behavior
Should be the same as with that curl (see Screenshot)
curl --location --request POST "https://sample.com" --header "Content-Type: application/json" --data "{ \"details\": { \"id\": \"11\", \"sample\": { \"name\": \"ankit\" } } }"

Screenshots
Successfull with -data
image

Not Successfull with -data-raw
image

App information (please complete the following information):

  • Postman Version 7.14.0
  • OS: Windows 10

Context
Generate Code Snippet creats --data-raw

image

@ivliskot
Copy link

ivliskot commented Jan 9, 2020

Yeah, we have noticed that as well :(

@atallon
Copy link

atallon commented Jan 14, 2020

Seeing the same on Version 7.15.0 w/ OS X 18.7.0 / x64

@swuppio
Copy link

swuppio commented Jan 20, 2020

any suggestions?

@pavelsaman
Copy link

I see the same issue in version 7.16.0, app for Windows OS x64

@garrucho
Copy link

garrucho commented Feb 4, 2020

It's really sad that the code generator, since their big update, changed to use --data-raw, and so we couldn't import these cURL anymore in a while.

@tiaraju
Copy link

tiaraju commented Feb 20, 2020

Same problem happening to me.
Any news about it?

Same problem reported in #7983

@kevinding0218
Copy link

Same issue happening to me on OS 10.15.3

@shreys7 shreys7 marked this as a duplicate of #8126 Mar 5, 2020
@shreys7 shreys7 marked this as a duplicate of #7983 Mar 5, 2020
@shreys7 shreys7 marked this as not a duplicate of #8126 Mar 5, 2020
@shreys7
Copy link
Member

shreys7 commented Mar 5, 2020

@wrssmi Thanks for reporting this issue. We are soon going to release a fix for this. Will keep you updated here.

@anirudhavpavashe
Copy link

Remove -raw which is after --data [--data -raw ]
just keep it as --data in the cURL

@anirudhavpavashe
Copy link

any suggestions?

Remove -raw which is after --data [--data -raw ]
just keep it as --data in the cURL

@siddharth5797
Copy link

@shreys7 On which version is this issue fixed? I am still facing this issue in version v7.21.0.

Postman for Linux
Version 7.21.0
linux 4.15.0-88-generic / x64

@shreys7
Copy link
Member

shreys7 commented Apr 1, 2020

Hello everyone, we have added the fix for this issue and it will be released with the next Postman App version - 7.22, planned on 8th April.
Thank you for your patience.

@RajatBanerjee
Copy link

Is this fixed ? i did a code generate and it still does --data-raw

@mccannt
Copy link

mccannt commented Apr 8, 2020

@RajatBanerjee Did you get the 7.22 version of the app yet? It is currently being rolled out to users.

If you haven't, please wait until you get the update and then try again. If you have received it and it's still not working, please let us know.

@shreys7
Copy link
Member

shreys7 commented Apr 9, 2020

Hey @RajatBanerjee , the issue wasn't the code generator generating a --data-raw in the snippet. It was about not able to import the cURL request body when using --data-raw argument. This has been fixed with the latest release. Do let us know if you have any other queries :)

@RajatBanerjee
Copy link

Got it @shreys7 . So the issue i am talking about is that considered a bug?

@shreys7
Copy link
Member

shreys7 commented Apr 12, 2020

@RajatBanerjee The unsuccessful import of body in cURL request with --data-raw flag was the only bug, which has been fixed with the latest release of App, 7.22

@vbothra
Copy link

vbothra commented Apr 22, 2020

I tried with v7.22. And the issue is not fixed yet. I am unable to import. Please see the attached video below:
image

Screen Recording 2020-04-22 at 6.58.23 PM.mov.zip

@JaswantBB
Copy link

instead of --data-row use --data-binary will work

@kasumiru
Copy link

kasumiru commented Mar 1, 2021

the bug is stiil here in chrome Version 88.0.4324.190 (Official Build) (64-bit)

@umeshp7
Copy link

umeshp7 commented Mar 2, 2021

Hey @kasumiru!
Are you using the Chrome App? We have actually deprecated the Chrome app version of Postman.
Although we have recently launched Postman on the Web - Here you can experience the latest Postman app with all the recent features directly on any web browser.

You can download the latest version of the native Postman apps or try out the Web version here: https://www.postman.com/downloads

Do try this out in one of the latest apps and let us know if you are still facing this.

@rxluz
Copy link

rxluz commented Mar 29, 2021

Hey folks, I updated my Postman to the last version and it seems that this problem remains, I tried to change the params like suggested in the post but also didn't work

I'm using Version 8.0.7 (8.0.7) (Mac)

@temamagic
Copy link

temamagic commented Apr 26, 2021

Same problem on newest version

image

@gregtuc
Copy link

gregtuc commented May 4, 2021

Issue is still occurring for me, Postman for Windows version 8.3.0.

@arlemi
Copy link
Collaborator

arlemi commented May 5, 2021

@temamagic @gregtuc Can you provide more information on what you're seeing? I've just given it a try on the latest version on Windows and the import works fine.

import-curl

@temamagic
Copy link

@arlemi Hi, sure!

In my case, I'll take request from Chrome and expect to see Form Data values

image

Chrome copy as curl return like this:

curl 'http://example' \
  -H 'Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7oJTsSWYoA2LdaPx' \
  --data-raw $'------WebKitFormBoundary7oJTsSWYoA2LdaPx\r\nContent-Disposition: form-data; name="source"\r\n\r\ns\r\n------WebKitFormBoundary7oJTsSWYoA2LdaPx\r\nContent-Disposition: form-data; name="destination"\r\n\r\nt\r\n------WebKitFormBoundary7oJTsSWYoA2LdaPx--\r\n' \
  --compressed \
  --insecure

I think that problem is in content-Type: multipart/form-data, cuz my request is a simple post with form data values and expect to see form data parsed, not raw json body

@temamagic
Copy link

Just checked, curl request copied from Charles proxy doesn't parsed properly too

Maybe I was wrong with issue? Anyway, Postman should learn how to parse multipart form data values from curl :)

@abhijitkane abhijitkane reopened this May 6, 2021
@tsundara
Copy link

For the generated curl command, how to get rid of the string --data-raw and just set it to --data?
Is there some built in setting to deal with this?

It is annoying as everytime I have to copy paste command to another editor and change text from data-raw to data

@Spaum145
Copy link

Spaum145 commented Sep 21, 2021

Still have problems, version 9.0.2.
Trying to import curl for post request with multipart/form-data request

curl -X POST '...' 
-H 'Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryDvazaXbGrGcqqTAA' \
...
--data-raw $'------WebKitFormBoundaryDvazaXbGrGcqqTAA\r\nContent-Disposition: form-data; name="contacts[][email]"\r\n\r\n\r\n------WebKitFormBoundaryDvazaXbGrGcqqTAA\r\nContent-Disposition: form-data;
name="contacts[][phone]"\r\n\r\n\r\n------WebKitFormBoundaryDvazaXbGrGcqqTAA\r\nContent-Disposition: form-data; 
...
name="country"\r\n\r\n0\r\n------WebKitFormBoundaryDvazaXbGrGcqqTAA--\r\n'

and got no body parsed

@VShingala
Copy link
Member

VShingala commented Mar 10, 2023

@tsundara Issue related to code snippet generation having --data-raw has been fixed now with latest postman app. Behavior now is --data should be present instead of --data-raw for almost all cases.

@Spaum145 We've identified the issue with formdata request you shared and will be working on a fix. I'll update here once fix is out.

@VShingala
Copy link
Member

@Spaum145 @temamagic

We've fixed the issues with cURL not able to import Multipart / formdata bodies correctly with the latest Postman App v10.13. Do let us know if you're facing further issues with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.