GET

测试接口

/
用于测试API服务是否正常运行的基础接口。

请求参数

此接口无需参数

请求示例

JavaScript
fetch('https://napi.luizhen.xyz/')
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error('Error:', error));
JavaScript
import axios from 'axios';

axios.get('https://napi.luizhen.xyz/')
  .then(response => console.log(response.data))
  .catch(error => console.error('Error:', error));
JavaScript
const xhr = new XMLHttpRequest();
xhr.open('GET', 'https://napi.luizhen.xyz/');
xhr.onload = function() {
  if (xhr.status === 200) {
    console.log(JSON.parse(xhr.responseText));
  }
};
xhr.send();
Bash
curl -X GET https://napi.luizhen.xyz/

响应示例

{
  "code": 200,
  "message": "Hello World",
  "data": {}
}