{ "code": 200, "msg": "数据请求成功!", "data": { "tu": "https:\/\/test.harumoe.cn\/storage\/random\/emoji\/qq\/tu.gif", "xigua": "https:\/\/test.harumoe.cn\/storage\/random\/emoji\/qq\/xigua.gif" } }
<?php /** * Created by PhpStorm. * User: FZS * Time: 2023/08/03 14:26 */ class freeApi { private $apiUrl; public function __construct() { $this->apiUrl = 'https://test.harumoe.cn/api/emoji/all'; } /** * 获取结果 * @return array */ public function getResult() { return file_get_contents($this->apiUrl); } }
package main import ( "fmt" "io/ioutil" "log" "net/http" ) const ( APIURL = "https://test.harumoe.cn/api/emoji/all" ) 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)) }