我正在尝试重新加载geoserver目录,但我收到以下错误:
远程服务器返回错误:(501)未实施。
这是代码
WebRequest serverRequest =WebRequest.Create("http://xxxx:8080/geoserver/rest/workspaces");
serverRequest.Method = "RELOAD";
serverRequest.Headers["Authorization"] = "Basic " + Convert.ToBase64String(Encoding.ASCII.GetBytes(password));
WebResponse serverResponse;
serverResponse = serverRequest.GetResponse();
serverResponse.Close();
答案 0 :(得分:1)
serverRequest.Method
与您要调用的REST Webservice(?)方法无关。
WebRequest.Method是GET
或POST
(或任何those defined for geoserver),除非有HttpModule实现协议方法RELOAD
。
根据地理服务器REST Configuration API Reference “配置重新加载”,您的通话应如下所示:
WebRequest serverRequest = WebRequest.Create("http://xxxx:8080/geoserver/rest/reload");
serverRequest.Method = "POST";
// get response ...