fix: consistent use of client var

master
phga 3 years ago
parent 15736f91d9
commit db25867e57

@ -96,10 +96,12 @@ Note: Use "" around everything but numbers, also wrap json in ''
os.Exit(1) os.Exit(1)
} }
data := args[0] data := args[0]
res, err := http.Post(resource, "application/json; charset=UTF-8", bytes.NewBufferString(data)) req, err := http.NewRequest(http.MethodPost, resource, bytes.NewBufferString(data))
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
req.Header.Set("Content-Type", "application/json; charset=UTF-8")
res, err := client.Do(req)
defer res.Body.Close() defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body) body, err := ioutil.ReadAll(res.Body)
if err != nil { if err != nil {

Loading…
Cancel
Save