C#에서 특정 주소에 대한 지오 코드 위치를 가져 오는 메소드가 있습니다. 그것은 시간의 큰 99 %를 작동합니다. 나는 흥미로운 상황에 빠져 누군가가 비슷한 상황에 빠지기를 바라고 있습니다. BING 포럼이나 개발 리소스를 통해 비슷한 문제를 찾을 수 없었습니다.BING Maps API 잃어버린 지오 코드
WebClient client = new WebClient();
client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)");
Stream data = client.OpenRead(uri);
StreamReader reader = new StreamReader(data);
string s = reader.ReadToEnd();
// Doing some magic with the response object here
이 특정 상황에 대한 URI는 다음과 같습니다
는http://dev.virtualearth.net/REST/v1/Locations?q=285%20Annshelia%20Dr,%20Keswick%20ON&key=<LIVEKEY>
우리가 서버에서지고 있다는 응답은 다음과 같습니다
{"authenticationResultCode":"ValidCredentials","brandLogoUri":"http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png","copyright":"Copyright © 2016 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.","resourceSets":[{"estimatedTotal":0,"resources":[]}],"statusCode":200,"statusDescription":"OK","traceId":"<THE_TRACE>"}
"X- 설정에는 HTML 헤더가 없습니다 MS-BM-WS-INFO "가되어 과부하 문제가 아니며 엔터프라이즈 키가 있습니다.
내가 관심있는 부분은 Bing Maps website으로 가서 285 Annshelia Dr, Keswick ON L4P 3A6의 주소를 검색하면 적절한 지오 코드 위치를 얻는 방법입니다.
지오 코드를 요청할 때 이것이 왜 내가 공허한 응시를 할 수 있는지에 대해 밝힐 수 있습니까?
바보 같은 질문이지만 URL에 쉼표를 % 2C (으)로 인코딩하려고 시도 했습니까? 때로는 쉼표로 추가하는 것이 char이 아닌 URL에서 구분 기호로 볼 수 있습니다. –
감사합니다. Ryan! URI를 만들 때 String.Format()에 HttpUtility.UrlEncode (주소)를 추가하더라도 여전히 동일한 응답을 얻고 있습니다. – AngieLeigh