错误“远程服务器返回错误:(501) 未实现。”使用 C# 重新加载 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();
I´m trying to reload a geoserver directory and I´m getting the following error:
The remote server returned an error: (501) Not Implemented.
This is the code
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();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
serverRequest.Method
与您要调用的 REST Webservice(?) 方法无关。WebRequest.Method 是
GET
或POST
(或任何 那些定义为geoserver),除非有一个 HttpModule 实现了协议方法RELOAD
。根据geoserver REST 配置 API 参考 < strong>“配置重新加载”您的调用应如下所示:
serverRequest.Method
is not related to a REST Webservice(?) method you want to invoke.WebRequest.Method is either
GET
orPOST
(or any of those defined for geoserver) unless there is a HttpModule which implements a protocol methodRELOAD
.According to the geoserver REST Configuration API Reference "Configuration Reloading" your call should look something like this: