Closed chaucerbao closed 7 years ago
Do you have g:vrc_curl_opts
(with -i
) or g:vrc_include_response_header
(or b:vrc_include_response_header
) set? I'm curious because your response comes with the headers while your request doesn't specify any curl options. It might or might not be a bug depending on those settings.
You can enable the debug mode and check what cUrl options are used with your request.
This is my config for VRC. Just one(-ish).
let g:vrc_curl_opts={
\'--include': '',
\'--location': '',
\'--show-error': '',
\'--silent': ''
\}
Basically equivalent to -sS -L -i
. I prefer using the long-form version of options in config files for legibility.
The output from vrc_show_command
is
curl --include --show-error -H 'Content-Type: application/json' --silent --location --get 'https://jsonplaceholder.typicode.com/comments//'
Oh, and removing cURL's -i
option still doesn't enable the syntax highlighting.
I see what went wrong. Just pushed the fix. Please retest. Thanks!
Works for --include
and -i
now!
However, there's no syntax highlighting if you're not using --include
/-i
.
By the way, thanks a lot for your work on this plugin. I like being able to stay in Vim to test APIs instead of constantly switching apps.
It's expected since without the returned headers, VRC doesn't know the content type to properly format or syntax-highlight the content. However, there are a couple ways if you don't want to include the --include
/-i
flag. Check out section 7.2 and option vrc_response_default_content_type
.
Glad that you enjoy VRC!
Makes sense. I'm used to assuming JSON by default.
I've noticed that the response window no longer has its syntax highlighted.
However, I can run a
:set ft=rest
on the__REST_response__
window to restore highlighting.