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 of cURL command with escaped single quotes not working #2791

Closed
greglockwood opened this issue Mar 9, 2017 · 1 comment
Closed

Import of cURL command with escaped single quotes not working #2791

greglockwood opened this issue Mar 9, 2017 · 1 comment

Comments

@greglockwood
Copy link

Version/App Information:

  1. Postman Version: 4.10.3
  2. App (Chrome app or Mac app): Chrome app
  3. OS details: Windows 10
  4. Is the Interceptor on and enabled in the app: Yes
  5. Did you encounter this recently, or has this bug always been there: Recently, not sure how long it has been there.
  6. Expected behaviour: Body of request is parsed correctly and is valid JSON.
  7. Console logs (http://blog.getpostman.com/2014/01/27/enabling-chrome-developer-tools-inside-postman/ for the Chrome App, View->Toggle Dev Tools for the Mac app): Not included, can be retrieved if required.
  8. Screenshots (if applicable)
    postman curl parsing bug

Steps to reproduce the problem:

  1. I copied a request from the Network panel of Chrome DevTools using right-click -> Copy -> Copy as cURL (bash) option.
  2. I pasted it into a Git Bash prompt on windows and it worked fine.
  3. I pasted it into the Import -> Raw Text textarea in postman and then reviewed the body tab and the JSON is not valid.

Here is a trimmed version of the cURL command I pasted that demonstrates the problem but removes most of the identifying data (Note that issuing this in a bash shell will result in a "Couldn't resolve host" error due to the made up domain name in the URL):

curl 'https://url.obscured/api/search' -H 'Pragma: no-cache' -H 'Accept-Encoding: gzip, deflate, br' -H 'Accept-Language: en-GB,en;q=0.8,en-US;q=0.6,en-AU;q=0.4' -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36' -H 'Content-Type: application/json;charset=UTF-8' -H 'Accept: application/json, text/plain, */*' -H 'Cache-Control: no-cache' -H 'Connection: keep-alive' --data-binary $'{"SearchTerms":[{"termValue":"`~!@#$%^&*()-+=<.,./?;:\'\\"[{]}\\\\|","termOption":2}]}' --compressed
@abhijitkane
Copy link
Member

Fixed in the latest Postman version.

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

No branches or pull requests

6 participants