From e73584b0d89a24cad1bcb3cb4ea87f1bbdc31a36 Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Sat, 11 Feb 2017 01:48:11 +0100 Subject: [PATCH] [fix] add default content-type to POST/PUT method --- wuzz.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wuzz.go b/wuzz.go index 9f0953d..ad9b64d 100644 --- a/wuzz.go +++ b/wuzz.go @@ -870,8 +870,12 @@ func (a *App) ParseArgs(g *gocui.Gui) error { return errors.New("No HTTP method specified") } arg_index++ + method := os.Args[arg_index] + if method == "POST" || method == "PUT" { + add_content_type = true + } vmethod, _ := g.View("method") - setViewTextAndCursor(vmethod, os.Args[arg_index]) + setViewTextAndCursor(vmethod, method) case "-t", "--timeout": if arg_index == args_len-1 { return errors.New("No timeout value specified")