{ "code": 200, "url": "free-api.com", "qq_msg": "正常", "vx_msg": "正常", "icp_name": "...", "icp": "皖ICP备17018155号-2", "tips": "免费api:https://www.free-api.com" }
<?php /** * Created by PhpStorm. * User: FZS * Time: 2023/04/07 22:56 */ class freeApi { private $apiUrl; public function __construct() { $this->apiUrl = 'https://v.api.aa1.cn/api/api-lj-gf/index.php?url=free-api.com'; } /** * 获取结果 * @return array */ public function getResult() { return file_get_contents($this->apiUrl); } }
package main import ( "fmt" "io/ioutil" "log" "net/http" ) const ( APIURL = "https://v.api.aa1.cn/api/api-lj-gf/index.php?url=free-api.com" ) 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)) }