Giter Site home page Giter Site logo

vial-http's Introduction

vial-http

Awesome http REST tool for vim

Templates in action: templates

Features:

  • Intuitive syntax mimics HTTP protocol
  • Templates to capture state
  • Response and connection times in status line
  • Automatic json request body detector
  • Automatic json/xml response formatter
  • Separate buffers for response body, response headers and request
  • DRY
  • Support for HTTP basic auth
  • Support for ssl client certificates

Install

vial-http is pathogen friendly and only requires vial to be installed:

cd ~/.vim/bundle
git clone https://github.com/baverman/vial.git
git clone https://github.com/baverman/vial-http.git

or for Plug:

Plug 'baverman/vial'
Plug 'baverman/vial-http'

Note: vim should be compiled with python or python3 support.

Docs

You need following options in your vimrc:

set hidden
filetype plugin on

hidden must be set because Vial-Http uses non-file temporary offscreen buffers with response content and without hidden they will be empty.

filetype plugin on needed for default keymap working.

Keymap:

  • <leader><cr> executes request line under the cursor
  • <c-k>/<c-j> cycle throw response/request/response headers windows

Commands:

  • :VialHttp executes request line under the cursor
  • :VialHttpBasicAuth [username] makes Authorization header

Tutorial

vial-http's People

Contributors

baverman avatar brianphillips avatar kikyous avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vial-http's Issues

vim starts with errors once vial and vial-http was installed

OS: windows 10
Python3
Gvim ver:

VIM - Vi IMproved 8.1 (2018 May 18, compiled Aug 13 2019 22:02:13)
MS-Windows 64-bit GUI version with OLE support
Included patches: 1-1845
Compiled by appveyor@APPVYR-WIN
Huge version with GUI.  Features included (+) or not (-):
+acl                +comments           +file_in_path       +listcmds           +persistent_undo    -sun_workshop       +vertsplit
+arabic             +conceal            +find_in_path       +localmap           -postscript         +syntax             +virtualedit
+autocmd            +cryptv             +float              +lua/dyn            +printer            +tag_binary         +visual
+autochdir          +cscope             +folding            +menu               +profile            -tag_old_static     +visualextra
+autoservername     +cursorbind         -footer             +mksession          +python/dyn         -tag_any_white      +viminfo
+balloon_eval       +cursorshape        +gettext/dyn        +modify_fname       +python3/dyn        +tcl/dyn            +vreplace
-balloon_eval_term  +dialog_con_gui     -hangul_input       +mouse              +quickfix           -termguicolors      -vtp
+browse             +diff               +iconv/dyn          +mouseshape         +reltime            +terminal           +wildignore
++builtin_terms     +digraphs           +insert_expand      +multi_byte_ime/dyn +rightleft          -termresponse       +wildmenu
+byte_offset        +directx            +job                +multi_lang         +ruby/dyn           +textobjects        +windows
+channel            -dnd                +jumplist           +mzscheme/dyn       +scrollbind         +textprop           +writebackup
+cindent            -ebcdic             +keymap             +netbeans_intg      +signs              -tgetent            -xfontset
+clientserver       +emacs_tags         +lambda             +num64              +smartindent        +timers             -xim
+clipboard          +eval               +langmap            +ole                +sound              +title              +xpm_w32
+cmdline_compl      +ex_extra           +libcall            +packages           +spell              +toolbar            -xterm_save
+cmdline_hist       +extra_search       +linebreak          +path_extra         +startuptime        +user_commands      
+cmdline_info       -farsi              +lispindent         +perl/dyn           +statusline         +vartabs            
   system vimrc file: "$VIM\vimrc"
     user vimrc file: "$HOME\_vimrc"
 2nd user vimrc file: "$HOME\vimfiles\vimrc"
 3rd user vimrc file: "$VIM\_vimrc"
      user exrc file: "$HOME\_exrc"
  2nd user exrc file: "$VIM\_exrc"
  system gvimrc file: "$VIM\gvimrc"
    user gvimrc file: "$HOME\_gvimrc"
2nd user gvimrc file: "$HOME\vimfiles\gvimrc"
3rd user gvimrc file: "$VIM\_gvimrc"
       defaults file: "$VIMRUNTIME\defaults.vim"
    system menu file: "$VIMRUNTIME\menu.vim"
Compilation: cl -c /W3 /nologo  -I. -Iproto -DHAVE_PATHDEF -DWIN32  -DFEAT_CSCOPE -DFEAT_TERMINAL -DFEAT_SOUND -DFEAT_NETBEANS_INTG -DFEAT_JOB_CHANNEL   -DFEAT_XPM_W32   -DWINVER=0x0501 -D_WIN32_WINNT=0x0501 /MP -DHAVE_STDINT_H /Ox /GL -DNDEBUG  /Zl /MT -DFEAT_OLE -DFEAT_MBYTE_IME -DDYNAMIC_IME -DFEAT_GUI_MSWIN -DFEAT_DIRECTX -DDYNAMIC_DIRECTX -DFEAT_DIRECTX_COLOR_EMOJI -DDYNAMIC_ICONV -DDYNAMIC_GETTEXT -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl86t.dll\" -DDYNAMIC_TCL_VER=\"8.6\" -DFEAT_LUA -DDYNAMIC_LUA -DDYNAMIC_LUA_DLL=\"lua53.dll\" -DFEAT_PYTHON -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"python27.dll\" -DFEAT_PYTHON3 -DDYNAMIC_PYTHON3 -DDYNAMIC_PYTHON3_DLL=\"python37.dll\" -DFEAT_MZSCHEME -I "C:\Program Files\Racket\include" -DMZ_PRECISE_GC -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"libracket3m_a36fs8.dll\" -DDYNAMIC_MZGC_DLL=\"libracket3m_a36fs8.dll\" -DFEAT_PERL -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl528.dll\" -DFEAT_RUBY -DDYNAMIC_RUBY -DDYNAMIC_RUBY_VER=24 -DDYNAMIC_RUBY_DLL=\"x64-msvcrt-ruby240.dll\" -DFEAT_HUGE /Fd.\ObjGXOULYHTRZAMD64/ /Zi
Linking: link  /nologo /opt:ref /LTCG:STATUS /HIGHENTROPYVA:NO oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib  comdlg32.lib ole32.lib netapi32.lib uuid.lib /machine:AMD64 gdi32.lib version.lib   winspool.lib comctl32.lib advapi32.lib shell32.lib netapi32.lib  /machine:AMD64  libcmt.lib oleaut32.lib user32.lib  /nodefaultlib:lua53.lib  /STACK:8388608  /nodefaultlib:python27.lib /nodefaultlib:python37.lib   "C:\Tcl\lib\tclstub86.lib" winmm.lib WSock32.lib xpm\x64\lib-vc14\libXpm.lib /PDB:gvim.pdb -debug

image

Other plugins made with python works for me (UltiSnips, LeaderF, etc)

Parsing JSON in templates doesn't work in python3

Hi,
I had to downgrade to python2 in order to make this works:

Host: jsonplaceholder.typicode.com
Origin: https://jsonplaceholder.typicode.com

TEMPLATE tryit
myvalue: ${json["try"]}

POST /posts | tryit
{ "try": "it" }

with python3 I always had:

myvalue: None

generated.

python3 support

I get "vial requires python support" error on load. Would be nice to have the plugin detect python3.

Neovim support?

I tried this in vim and it worked but when I tried it in neovim I got the following error.

Error detected while processing function provider#python#Call:
line   18:
Invalid channel: 1

This might be a python version issue as well?

Response Code : 302

I just try to use vial-http with some GET requests.
But when the url is like https://tmall.com I get 302 which is what I don't want.
Although I know vial-http is for rest quests, I still think if it can hadle 302 it will better.

Use LocalLeader for default mapping

Great plugin!

I'd like to suggest that the 'default mapping' for vial-http be changed to use <LocalLeader> rather than <Leader>, or at least for the mapping to be hidden behind a conditional check like if !g:vial_http_suppress_default_mapping.

<LocalLeader> is provided exactly for cases like this, to reduce the chances of collision with users' existing settings:

from :h maplocalleader

<LocalLeader> is just like <Leader>, except that it uses "maplocalleader"
instead of "mapleader". <LocalLeader> is to be used for mappings which are
local to a buffer.

In a global plugin <Leader> should be used and in a filetype plugin
<LocalLeader>.

Generate .http syntax from existing formats

vial-http improves my workflow a lot, but one thing that isn't as easy is getting the requests into the vial-http format. Having some way of creating those files from e.g. a curl command line (since browsers export those) or the mitmproxy exports would be pretty neat

utf-8 support?

the post request failed on a json object with Chinese characters.

POST /rules/parse
{
"patients": [
{
"name": "M1",
"age": 68,
"gender": "ๅฅณ"
}
]
}

Vertical split

Hi,

really nice tool, I'm adopting it.
Is there any way to have the request windo in a vertical split instead of horizontal one?

Cheers

font in example

Nice plugin, thanks.
What font are you using in the example?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.