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

Multi-part form cURL export incorrect #3868

Open
lars06 opened this issue Jul 30, 2021 · 1 comment
Open

Multi-part form cURL export incorrect #3868

lars06 opened this issue Jul 30, 2021 · 1 comment
Labels
B-bug Bug: general classification S-verified Status: Verified by maintainer

Comments

@lars06
Copy link

lars06 commented Jul 30, 2021

When sending a POST request for multi-part form in Insomnia, everything works as expected. However, when I copy as cURL command, or generate shell cURL code, I receive a command line error when running the command: curl: (26) Failed to open/read local data from file/application. After trying the same request and exporting cURL in Postman, the correct shell command is generated. It appears to be related to the XML field.

To Reproduce
Steps to reproduce the behavior:

  1. Create multi-part form with fields as follows:
timestamp: 2021-07-14T01:02:34.567Z
field: test
data: <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<test>TEST<test>
  1. Copy to curl
  2. Run command in shell

Expected behavior
Correct cURL is copied which is quoted/escaped in correct way

Desktop

  • OS: macOS 11.3.1
  • Insomnia: 2021.4.1

Additional context
Insomnia output:

curl --request POST \
  --url https://test.com/ \
  --header 'Content-Type: multipart/form-data; boundary=---011000010111000001101001' \
  --form timestamp=2021-07-14T01:02:34.567Z \
  --form field=test \
  --form 'data=<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<test>TEST<test>'

Postman output:

curl --location --request POST 'https://test.com' \
--form 'timestamp="2021-07-14T01:02:34.567Z"' \
--form 'field="test"' \
--form 'data="<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>
<test>TEST<test>"'
@filfreire
Copy link
Member

Hi @lars06, thank you for reporting this!

I was able to reproduce your issue.

This needs to be fixed on the underlying library (httpsnippet) we use for generating curl and other requests on insomnia. I went ahead and created an issue there so we can follow up as soon as possible.

@filfreire filfreire added S-verified Status: Verified by maintainer and removed S-unverified Status: Unverified by maintainer labels May 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-bug Bug: general classification S-verified Status: Verified by maintainer
Projects
None yet
Development

No branches or pull requests

2 participants