aboutsummaryrefslogtreecommitdiff
path: root/weed/util/http_util.go
diff options
context:
space:
mode:
authorhilimd <68371223+hilimd@users.noreply.github.com>2020-11-16 16:30:19 +0800
committerGitHub <noreply@github.com>2020-11-16 16:30:19 +0800
commit218561c206943d179740a80d8bb21e1f42b35daa (patch)
treeefabb31545c495648d99d4b2eb7ea7536d17d8e3 /weed/util/http_util.go
parente0d5207ed9ff6350e83497586ac9859d841a711a (diff)
parentc0d279c54e56882bc0ecdf496ecfcbcfa1c6d6e3 (diff)
downloadseaweedfs-218561c206943d179740a80d8bb21e1f42b35daa.tar.xz
seaweedfs-218561c206943d179740a80d8bb21e1f42b35daa.zip
Merge pull request #37 from chrislusf/master
sync
Diffstat (limited to 'weed/util/http_util.go')
-rw-r--r--weed/util/http_util.go17
1 files changed, 0 insertions, 17 deletions
diff --git a/weed/util/http_util.go b/weed/util/http_util.go
index 48823c1c3..7851d8293 100644
--- a/weed/util/http_util.go
+++ b/weed/util/http_util.go
@@ -1,7 +1,6 @@
package util
import (
- "bytes"
"compress/gzip"
"encoding/json"
"errors"
@@ -29,22 +28,6 @@ func init() {
}
}
-func PostBytes(url string, body []byte) ([]byte, error) {
- r, err := client.Post(url, "", bytes.NewReader(body))
- if err != nil {
- return nil, fmt.Errorf("Post to %s: %v", url, err)
- }
- defer r.Body.Close()
- b, err := ioutil.ReadAll(r.Body)
- if err != nil {
- return nil, fmt.Errorf("Read response body: %v", err)
- }
- if r.StatusCode >= 400 {
- return nil, fmt.Errorf("%s: %s", url, r.Status)
- }
- return b, nil
-}
-
func Post(url string, values url.Values) ([]byte, error) {
r, err := client.PostForm(url, values)
if err != nil {