我搜索并没有找到如何使用 curl 和 C# 删除工作区,
我可以使用 Curl 和 C# 创建工作区,但我不知道是否可以使用相同的工具删除工作区
提前致谢
string url = "http://xxxxxxxxxxx:8080/geoserver/rest/workspaces";
WebRequest request = WebRequest.Create(url);
request.ContentType = "text/xml";
request.Method = "DELETE";
string authInfo = "xxxx:xxxxxxx";
request.Headers["Authorization"] = "Basic " + Convert.ToBase64String(Encoding.ASCII.GetBytes(authInfo));
byte[] buffer = Encoding.GetEncoding("UTF-8").GetBytes("<workspace><name>testWorkspace</name></workspace>");
Stream reqstr = request.GetRequestStream();
reqstr.Write(buffer, 0, buffer.Length);
reqstr.Close();
WebResponse response = request.GetResponse();