Shorthand functions request with common HTTP methods

This commit is contained in:
Roberto Abdelkader Martínez Pérez
2019-10-03 15:06:26 +02:00
parent 43abacbb2f
commit b1c2db057c
3 changed files with 30 additions and 10 deletions
+1 -1
View File
@@ -9,5 +9,5 @@ import (
//GetData will perform the request and write the results on the provided writer
func GetData(host, id, path string, wr io.Writer) error {
url := host + "/handlers/" + id + path
return http.Do("GET", url, nil, wr)
return http.Get(url, nil, wr)
}