From 12c4fb33bc666ebe5f3f273efa2e50c8c76e39dc Mon Sep 17 00:00:00 2001 From: laz Date: Fri, 22 Mar 2019 12:58:58 -0400 Subject: [PATCH] Other HTTP Methods support payloads Fix to allow other HTTP methods such as PUT and PATCH to support including request payloads. Follows HTTP standards and improves compatibility with curl. --- options.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/options.go b/options.go index 7be4c1f..72891c1 100644 --- a/options.go +++ b/options.go @@ -271,7 +271,9 @@ func (opts *Options) BuildTargetSpecificOptions(target string) (io.Reader, error // Process headers and post data if len(opts.data) > 0 || len(opts.fdata) > 0 { var data bytes.Buffer - opts.method = "POST" + if opts.method == "" { + opts.method = "POST" + } header := "" -- GitLab