JS的fetch()

fetch("https://datahold.cn")
    .then((response) => {
        console.log(response);
    });

fetch 是一个用于在 JavaScript 中进行网络请求的函数。它基于 Promise API,允许你轻松地发送 HTTP 请求并处理响应。

展开/折叠结果
Response {
  status: 200,
  statusText: 'OK',
  headers: Headers {
    server: 'nginx',
    date: 'Sat, 21 Dec 2024 13:04:22 GMT',
    'content-type': 'text/html; charset=UTF-8',
    'transfer-encoding': 'chunked',
    connection: 'keep-alive',
    'strict-transport-security': 'max-age=31536000',
    vary: 'Accept-Encoding, accept, content-type, cookie',
    'x-hacker': 'Want root?  Visit join.a8c.com and mention this header.',
    'host-header': 'WordPress.com',
    link: '; rel="https://api.w.org/", ; rel=shortlink',
    'last-modified': 'Sat, 21 Dec 2024 13:04:07 GMT',
    'cache-control': 'max-age=300, must-revalidate',
    'x-nananana': 'Batcache-Set',
    'content-encoding': 'br',
    'x-ac': '2.hhn _atomic_ams HIT',
    'alt-svc': 'h3=":443"; ma=86400'
  },
  body: ReadableStream { locked: false, state: 'readable', supportsBYOB: true },
  bodyUsed: false,
  ok: true,
  redirected: false,
  type: 'basic',
  url: 'https://datahold.cn/'
}

评论

发表评论

了解 数据控|突破是我们的每一步 的更多信息

立即订阅以继续阅读并访问完整档案。

继续阅读