{ "error_code": 0, "result": [{ "name": "池州梅里博爱医院", "type": "综合医院", "level": "无等级", "address": "池州市贵池区高脊岭乡梅里村" }, { "name": "池州市贵池区血防站", "type": "综合医院", "level": "无等级", "address": "池州市贵池区秋浦西路37号" }, { "name": "池州市贵池区妇幼保健所", "type": "妇幼保健所", "level": "无等级", "address": "池州市贵池区" }, { "name": "池州市贵池区中医院", "type": "中医医院", "level": "无等级", "address": "安徽省池州市贵池区和平路120号" }, { "name": "池州市贵池区第二人民医院", "type": "综合医院", "level": "无等级", "address": "安徽省池州市贵池区殷汇村" }, { "name": "池州市贵池区人民医院", "type": "综合医院", "level": "无等级", "address": "池州市秋浦西路28号" }, { "name": "池州市妇幼保健所", "type": "妇幼保健所", "level": "无等级", "address": "池州市贵池区" }, { "name": "池州市第二人民医院", "type": "综合医院", "level": "二甲", "address": "池州市秋浦西路125号" }, { "name": "池州市人民医院", "type": "综合医院", "level": "三甲", "address": "安徽省池州市百牙中路3号" }] }
<?php /** * Created by PhpStorm. * User: FZS * Time: 2020/08/04 12:46 */ class freeApi { private $apiUrl; public function __construct() { $this->apiUrl = 'http://zhouxunwang.cn/data/?id=113&key=R5RTF4G5F5H&name=德州'; } /** * 获取结果 * @return array */ public function getResult() { return file_get_contents($this->apiUrl); } }
package main import ( "fmt" "io/ioutil" "log" "net/http" ) const ( APIURL = "http://zhouxunwang.cn/data/?id=113&key=R5RTF4G5F5H&name=德州" ) func main() { queryUrl := fmt.Sprintf("%s",APIURL) resp, err := http.Get(queryUrl) if err != nil { log.Println(err) return } defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) }