欢迎使用 WOW API 平台!
WOWAPI 合成展示图
当前时间
运行正常

周公解梦

接口地址
https://api.wq.cgdey.cn/API/zhougong/zhougong.php
请求方式GET
返回格式JSON
请求参数:
名称必填类型描述
key string 接口调用密钥。
word string 查询关键词,必须是三个字,例如:去旅游、梦见蛇、被追赶。
返回参数:
名称类型描述
keyword string 查询使用的关键词。
count integer 返回的解梦结果条数。
items array 解梦结果数组,每项包含 title 和 res。
状态码说明:
HTTP 状态业务状态说明
200success请求成功,已返回周公解梦数据。
503maintain接口临时维护中。
系统级错误:
状态码错误标识说明
400bad_request请求格式错误或参数不符合要求。
429too_many_requests请求过于频繁,请稍后重试。
500server_error服务器内部异常,未正常返回内容。
GET 请求:
<?php
echo file_get_contents('https://api.wq.cgdey.cn/API/zhougong/zhougong.php');
POST 请求:
<?php
$ch = curl_init('https://api.wq.cgdey.cn/API/zhougong/zhougong.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['key' => 'value']));
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
GET 请求:
import requests

response = requests.get('https://api.wq.cgdey.cn/API/zhougong/zhougong.php')
print(response.text)
POST 请求:
import requests

response = requests.post(
    'https://api.wq.cgdey.cn/API/zhougong/zhougong.php',
    json={'key': 'value'}
)
print(response.text)
GET 请求:
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.wq.cgdey.cn/API/zhougong/zhougong.php"))
    .GET()
    .build();

HttpResponse<String> response = HttpClient.newHttpClient()
    .send(request, HttpResponse.BodyHandlers.ofString());

System.out.println(response.body());
POST 请求:
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.wq.cgdey.cn/API/zhougong/zhougong.php"))
    .header("Content-Type", "application/json")
    .POST(HttpRequest.BodyPublishers.ofString("{\"key\":\"value\"}"))
    .build();

HttpResponse<String> response = HttpClient.newHttpClient()
    .send(request, HttpResponse.BodyHandlers.ofString());

System.out.println(response.body());
复制成功