Support custom headers

This commit is contained in:
Tim Pope
2015-11-30 20:29:26 -05:00
parent 9efd827089
commit 35cc8afbba

View File

@@ -128,6 +128,9 @@ function! s:curl_arguments(path, ...) abort
if has_key(options, 'method')
call extend(args, ['-X', toupper(options.method)])
endif
for header in get(options, 'headers', [])
call extend(args, ['-H', header])
endfor
if type(get(options, 'data', '')) != type('')
call extend(args, ['-d', rhubarb#json_generate(options.data)])
elseif has_key(options, 'data')