Closed shanesmith closed 8 years ago
I tried to avoid using -X POST
(according to curl
man page) but forgot that without the request body (--data
), curl
would treat it as GET
.
We have a couple options.
-X POST
for empty body, or--data ''
for POST
. I'm not sure how curl
behaves when both --data
and --data-binary
are used.Reading the curl man page I don't think you necessarily need to avoid using -X POST
, it rather says that you "normally don't need this option" since other options will internally set the verb. In my opinion I don't think explicitly setting -X
would be an issue.
Otherwise, if you still don't want to explicitly set it, I think your first option would be a little cleaner.
I think it should be fine to always use -X POST
since -X POST --data 'f1=v1'
is still a true POST request anyway.
Thanks!
The plugin intentionally omits the
-X
curl flag when the verb is POST, which is causing me issues with a certain POST api that doesn't require data in the body, in which case the curl command from VRC will effectively be a GET.Easy to patch, but I was first wondering why this was done?
https://github.com/diepm/vim-rest-console/blob/master/ftplugin/rest.vim#L294