【问题标题】:ArcGis Connection Error using RestSharp使用 RestSharp 的 ArcGis 连接错误
【发布时间】:2014-05-05 19:00:14
【问题描述】:

我正在尝试从 Xamarin.iOS 应用连接到 ArcGis 以将地址地理编码为纬度/经度。我正在使用这种方式发起请求:

var request = new RestRequest ("arcgis/rest/services/World/GeocodeServer/find?f=pjson&text=380+New+York+Street+Redlands+CA+92373", Method.POST);
request.AddParameter ("content-type", "application/json");

var client = new RestClient("http://geocode.arcgis.com/");
var response = client.Execute (request);
var jsonOutput = response.Content;

但是,它总是返回空白,并给出错误“无效的 Cookie 域:geocode.arcgis.com”。为什么会发生此错误?我想不通...

【问题讨论】:

    标签: ios .net xamarin.ios xamarin arcgis


    【解决方案1】:

    我已经在 Xamarin 商店(称为ArcGIS.PCL)上放置了一个 ArcGIS 组件,如果您想尝试,它会演示如何在示例项目中调用此操作(它是免费的)。

    我认为您的问题归结为底层 http 客户端连接,因为使用类似 modernhttpclient 的东西似乎可以防止该错误发生。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-11-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-07-10
      • 1970-01-01
      • 1970-01-01
      • 2021-03-11
      相关资源
      最近更新 更多