javascript - API不在Json中吗?

标签 javascript node.js api youtube

我正在使用以下API:https://decapi.me/youtube/latest_video?id=UCFaV5im11vfhDs1BaaF9a0A,它获取用户的最新youtube视频,但它不是JSON格式,因此我不确定如何检索数据。我正在使用node-fetch

最佳答案

node-fetch documentation:

Decode content encoding (gzip/deflate) properly, and convert string output (such as res.text() and res.json()) to UTF-8 automatically.



尝试res.text()吗?

关于javascript - API不在Json中吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43126125/

相关文章:

java - Retrofit 需要太多时间才能得到响应

javascript - 如何从 Javascript 获取 Payeezy API 响应到 PHP 文件?

sql - 使用 sequelize 处理竞争条件容易出错的代码

javascript - 如何阻止 Google reCAPTCHA 显示警报?

javascript - Google plus 是如何在 contenteditable div 处实现 Javascript 明文 "paste"的?

javascript - 错误 $.fn.DataTable.TableTools 不是函数

javascript - 使用 setInterval() 无限异步循环

node.js - http ://localhost:3000/api/stuff: 400 Bad Request 的 HTTP 失败响应

database - 为什么我不应该让外人访问我的数据库?

javascript - 根据给定的标准重新排列 DOM 元素