Tag: getjson

Weather Underground API正在返回带有格式化字符(大量\ n \ t等)的JSON。 有没有办法从他们得到未格式化的JSON?

这是我从Weather Underground得到的回应: “\n{\n \”response\”: {\n \”version\”:\”0.1\”,\n \”termsofService\”:\”http://www.wunderground.com/weather/api/d/terms.html\”,\n \”features\”: {\n \”geolookup\”: 1\n }\n\t}\n\t\t,\t\”location\”: {\n\t\t\”type\”:\”INTLCITY\”,\n\t\t\”country\”:\”EG\”,\n\t\t\”country_iso3166\”:\”EG\”,\n\t\t\”country_name\”:\”Egypt\”,\n\t\t\”state\”:\”\”,\n\t\t\”city\”:\”Wadi El Natroon\”,\n\t\t\”tz_short\”:\”EET\”,\n\t\t\”tz_long\”:\”Africa/Cairo\”,\n\t\t\”lat\”:\”30.000000\”,\n\t\t\”lon\”:\”30.000000\”,\n\t\t\”zip\”:\”00000\”,\n\t\t\”magic\”:\”1\”,\n\t\t\”wmo\”:\”62357\”,\n\t\t\”l\”:\”/q/zmw:00000.1.62357\”,\n\t\t\”requesturl\”:\”global/stations/62357.html\”,\n\t\t\”wuiurl\”:\”http://www.wunderground.com/global/stations/62357.html\”,\n\t\t\”nearby_weather_stations\”: {\n\t\t\”airport\”: {\n\t\t\”station\”: [\n\t\t{ \”city\”:\”Wadi El Natroon\”, \”state\”:\”\”, \”country\”:\”Egypt\”, \”icao\”:\”\”, \”lat\”:\”30.40250015\”, \”lon\”:\”30.36333275\” }\n\t\t,{ \”city\”:\”Alexandria Borg El Arab\”, \”state\”:\”\”, \”country\”:\”EG\”, \”icao\”:\”HEBA\”, \”lat\”:\”30.91769981\”, \”lon\”:\”29.69639969\” }\n\t\t,{ \”city\”:\”Alexandria\”, \”state\”:\”\”, \”country\”:\”EG\”, \”icao\”:\”HEAX\”, \”lat\”:\”31.18166733\”, \”lon\”:\”29.94638824\” }\n\t\t]\n\t\t}\n\t\t,\n\t\t\”pws\”: {\n\t\t\”station\”: [\n\t\t]\n\t\t}\n\t\t}\n\t}\n}\n” 正如你所看到的,有一堆不应该在那里的角色。 是否有一个不同的查询来获得无格式的JSON或我必须解析所有这些垃圾之前,把它交给一个JSON解析器? 我在某种调试模式或什么?