@@ -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)
+ 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)