diepm / vim-rest-console

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

PUT and --data-binary #69

Closed manatarms closed 5 years ago

manatarms commented 5 years ago

I'm trying to have a PUT request use the --data-binary curl option, but it seems the plugin seems to be adding --data and putting the flag as the data. See example below

Request

# Global scope.

let g:vrc_curl_opts = {
  \ '--data-binary': '~/Desktop/img.jpg'
\}

--
--

PUT /url/img
--data-binary: '@~/Desktop/img.jpg'

Raw curl

curl -X PUT --data '--data-binary @~/Desktop/img.jpg' '/url/img'

How would I tell the plugin to use data-binary instead of data?

diepm commented 5 years ago

Can you do

PUT /url/img
@~/Desktop/img.jpg

and can you use POST instead of PUT?

manatarms commented 5 years ago
PUT /url/img
@~/Desktop/img.jpg\

This worked. Thank you. I'm happy to make a PR to update docs, if PRs are welcome.

diepm commented 5 years ago

Yes, please. Thanks!