wcj 5 years ago
parent
commit
ae2e7e39ac
1 changed files with 14 additions and 0 deletions
  1. 14 0
      common/src/qfw/util/weedcl/client.go

+ 14 - 0
common/src/qfw/util/weedcl/client.go

@@ -86,6 +86,20 @@ func (c *Client) Delete(fid, url string) (err error) {
 	return
 }
 
+//删除文件
+func (c *Client) NewDelete(fid, url string) ([]byte, error) {
+	req, err := http.NewRequest("DELETE", fmt.Sprintf("http://%s/%s", url, fid), nil)
+	if err != nil {
+		return nil, err
+	}
+	resp, err := c.httpclient.Do(req)
+	if err != nil {
+		return nil, err
+	}
+	defer resp.Body.Close()
+	return ioutil.ReadAll(resp.Body)
+}
+
 //更新文件
 func (c *Client) Update(path, url, fid string) (string, string, error) {
 	fi, err := os.Open(path)