API 在线调试

粘贴 API Key 并选择服务,在浏览器中直接测试

API Key

还没有 API Key

选择服务

加载服务列表中...

当前请求

GET/v1/weather/
/v1/weather/
请先在控制台中创建 API Key,然后将完整的 Key 粘贴到左侧输入框中。

响应

// 选择 API Key 和服务,点击"发送"查看结果

调用示例

import java.net.URI;
import java.net.http.*;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("/v1/weather/"))
    .header("Authorization", "Bearer YOUR_API_KEY")
    .GET()
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());