diepm / vim-rest-console

A REST console for Vim.
658 stars 54 forks source link

String escaping in windows and Non-Windows shells #87

Open Loicniragire opened 4 years ago

Loicniragire commented 4 years ago

Suppose the following Post is intended:

http://something.com Content-Type: application/x-www.form-urlencoded POST /identity/token grant_type=password username=Joe password=hello

Option 1: Set vrc_split_request_body = 1 in your vimrc - the above request would work but subsequent requests will also be split. Not necessarily a desired effect.

Option 2: Do not set vrc_split_request_body to 1 in your vimrc but instead issue the following body: grant_type=password&username=Joe&password=hello Technically this should work except, on windows at least, the above request body is escaped as follow: grant_type=password\&username=Joe\&password=hello

(I traced this escaping effect to ftplugin\rest.vim - function Shellescape(val))

As a temporarily solution, bypassing Shellescape function seems to work for option 2.