<?php
$url = 'https://api.luochen.xyz/API/hot_list.php';
$params = ['platform' => 'YOUR_VALUE', ];
$url .= '?' . http_build_query($params);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
import requests
url = "https://api.luochen.xyz/API/hot_list.php"
params = {
'platform': 'YOUR_VALUE',
}
response = requests.get(url, params=params)
print(response.text)
const url = new URL('https://api.luochen.xyz/API/hot_list.php');
const params = {
'platform': 'YOUR_VALUE',
};
Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));
fetch(url)
.then(response => response.text())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
<!DOCTYPE html>
<html>
<head>
<title>API调用示例</title>
</head>
<body>
<div id="result">加载中...</div>
<script>
fetch('https://api.luochen.xyz/API/hot_list.php?platform=YOUR_VALUE')
.then(res => res.text())
.then(data => document.getElementById('result').textContent = data)
.catch(err => console.error(err));
</script>
</body>
</html>
import java.net.http.*;
import java.net.URI;
public class ApiClient {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.luochen.xyz/API/hot_list.php?platform=YOUR_VALUE"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
curl -X GET "https://api.luochen.xyz/API/hot_list.php?platform=YOUR_VALUE" \
-H "Accept: application/json"