package network import ( "fmt" "net/url" "testing" ) func Test_MethodHttp(t *testing.T) { uri := "http://Controller_Ip/SaaS/nextcloud/remote.php/webdav" u, err := url.Parse(uri) fmt.Println(u, err) fmt.Println(u.Scheme, u.Host, u.Path, u.Fragment, u.RawQuery) // url := "http://admin:123456@10.0.66.29/SaaS/nextcloud/remote.php/dav/files/admin/CZNTQK2" // data, err := MethodHttp("DELETE", url, "") // t.Log(string(data), err) // url := "http://admin:123456@10.0.66.29/nextcloud/index.php/apps/files/ajax/getstoragestats.php?dir=/" // data, err := MethodHttp("GET", url, "") // t.Log(string(data)) // t.Log(err) // url = "http://admin:123456@10.0.66.29/nextcloud/remote.php/dav/files/admin/" // data, err = MethodHttp("PROPFIND", url, "") // t.Log(string(data)) // t.Log(err) // url = "http://admin:123456@10.0.66.29/nextcloud/index.php/settings/ajax/setquota.php" // args := "username=admin"a=30GB&norequesttoken=true" // data, err = MethodHttp("POST", url, args) // t.Log(string(data)) // t.Log(err) // url = "http://admin:123456@10.0.66.29/nextcloud/index.php/apps/files/ajax/list.php?dir=/Photos" // data, err = MethodHttp("GET", url, "") // t.Log(string(data)) // t.Log(err) // url = "http://" + "raydesktop.gxycloud.com" + ":" + "8082" + "/extranet" // args = "key=DBKHPW39" // data, err = MethodHttp("POST", url, args) // t.Log(string(data)) // t.Log(err) // url = "http://admin:123456@10.0.66.29/nextcloud/remote.php/dav/files/admin/ncikZ0fxX1gy5qV2018012504/7b531e26d2dee30271" // data, err = MethodHttp("MKCOL", url, "") // t.Log(string(data)) // t.Log(err) }