Open dvisztempacct opened 5 years ago
Actually, the progress meter goes is written to stderr, so for my use cases, curl
could still work, as long as stderr is redirected somewhere (/dev/null
)
This works for me:
diff --git a/ftplugin/rest.vim b/ftplugin/rest.vim
index 2dea5c6..c0857a4 100644
--- a/ftplugin/rest.vim
+++ b/ftplugin/rest.vim
@@ -738,7 +738,7 @@ function! s:RunQuery(start, end)
silent !clear
redraw!
- call add(outputInfo['outputChunks'], system(curlCmd))
+ call add(outputInfo['outputChunks'], system(curlCmd . ' 2> /dev/null'))
if shouldShowCommand
call add(outputInfo['commands'], curlCmd)
endif
Maybe this could become a configurable behavior :)
Have you tried with -s
and -S
option? /dev/null
won't work for Windows users though.
@diepm no combination of arguments I could find actually produced the result I wanted, which was to always see the response body even if the HTTP status indicates an error, and no progress output.
I'm not sure what Windows users can do, but maybe this can be put in a check for paltform, or for if the file exists.
@dvisztempacct try this
" vim-rest-console
let g:vrc_curl_opts = {
\ '--connect-timeout' : 10,
\ '-b': '/path/to/cookie',
\ '-c': '/path/to/cookie',
\ '-L': '',
\ '-i': '',
\ '-s': '',
\ '--max-time': 60,
\ '--ipv4': '',
\ '-k': '',
\}
I've been running
curl
from the vim command line for a while now and have not been able to figure out how to getcurl
to two important things at the same time:1) Silence the progress meter 2) Display server responses on failure response status
It looks like this plugin suffers the same humiliation:
IMO the progress meter is annoying and irrelevant 99.9% of the time.
Maybe a different http client would work better?