0
我想從這個API呼叫響應:谷歌的地理編碼API返回一個奇怪的響應(二進制?)
在瀏覽網站的響應是確定的。但是,當我用這個方法:
private static string GetResultString(string geocodingUrlApi)
{
HttpWebRequest webRequest = (HttpWebRequest)HttpWebRequest.Create(geocodingUrlApi);
webRequest.Method = "GET";
webRequest.ContentType = "application/json";
webRequest.UserAgent = "WayMoto 1.0";
HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse();
StreamReader reader = new StreamReader(webResponse.GetResponseStream());
string response = reader.ReadToEnd();
return response;
}
內容的方法參數geocodingUrlApi:響應變種
內容:
感謝您的幫助。
看起來像一個字符編碼問題。 – geocodezip