logo
  • 教程列表
  • SO官方文檔
  • 取
    • 獲取 JSON 資料
    • 設定請求標頭
    • 釋出資料
    • GlobalFetch
    • 傳送 cookies
    • 使用 Fetch 從 Stack Overflow API 中顯示問題
  1. StackOverflow 文件
  2. JavaScript 教程
  3. 取
  4. 獲取 JSON 資料

獲取 JSON 資料

Created: November-22, 2018

// get some data from stackoverflow
fetch("https://api.stackexchange.com/2.2/questions/featured?order=desc&sort=activity&site=stackoverflow")
  .then(resp => resp.json())
  .then(json => console.log(json))
  .catch(err => console.log(err));
  • 設定請求標頭
  • 取

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明