{ "code": 200, "data": [{ "name": "元旦", "hoilday": [ "2023-12-30", "2023-12-31", "2024-01-01" ] }, { "name": "春节", "hoilday": [ "2024-02-10", "2024-02-11", "2024-02-12", "2024-02-13", "2024-02-14", "2024-02-15", "2024-02-16", "2024-02-17" ] }, { "name": "清明节", "hoilday": [ "2024-04-04", "2024-04-05", "2024-04-06" ] }, { "name": "劳动节", "hoilday": [ "2024-05-01", "2024-05-02", "2024-05-03", "2024-05-04", "2024-05-05" ] }, { "name": "端午节", "hoilday": [ "2024-06-10" ] }, { "name": "中秋节", "hoilday": [ "2024-09-15", "2024-09-16", "2024-09-17" ] }, { "name": "国庆节", "hoilday": [ "2024-10-01", "2024-10-02", "2024-10-03", "2024-10-04", "2024-10-05", "2024-10-06", "2024-10-07" ] } ], "message": "" }
<?php /** * Created by PhpStorm. * User: FZS * Time: 2024/11/27 22:11 */ class freeApi { private $apiUrl; public function __construct() { $this->apiUrl = 'https://api.istero.com/resource/hoilday/query?token=TOKEN&year=2024'; } /** * 获取结果 * @return array */ public function getResult() { return file_get_contents($this->apiUrl); } }
package main import ( "fmt" "io/ioutil" "log" "net/http" ) const ( APIURL = "https://api.istero.com/resource/hoilday/query?token=TOKEN&year=2024" ) 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)) }