YouTube API提取发送响应,但我无法访问项目

时间:2019-02-24 01:17:21

标签: javascript youtube-api fetch

关于我遇到的问题的其他问题似乎集中在拥有不正确的钥匙上,但是我认为我已经解决了这个问题,现在我很困惑。 。 。是YouTube API还是fetch()的问题?

简而言之,我要发送:

export function loadVideo() {
  fetch("https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=25&order=relevance&q=WOODYGUTHRIE&topicId=%2Fm%2F04rlf&type=video&videoCaption=any&key=MYKEY")
    .then(function (response) {
      console.log(queryString);
      console.log(response);
    })
    .catch(err => console.log(err));
  console.log(videoList);
}

仅查看我的日志,该查询字符串就可以在浏览器中加载我想要的JSON,并且记录response本身会给我:

Response {type: "cors", url: "https://www.googleapis.com/youtube/v3/search?part=…n=any&key=MYKEY", redirected: false, status: 200, ok: true, …}
body: (...)
bodyUsed: false
headers: Headers {}
ok: true
redirected: false
status: 200
statusText: ""
type: "cors"
url: "https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=25&order=relevance&q=WOODYGUTHRIE&topicId=%2Fm%2F04rlf&type=video&videoCaption=any&key=MYKEY"
__proto__: Response

无论如何,我将其切成薄片,response.itemsresponse.body.itemsresponse.data.items,得到undefined。因此,我无法自拔,在故障排除中还没有找到清晰的路径。

我俯瞰什么?

1 个答案:

答案 0 :(得分:0)

examples显示的响应应具有一个~/my_oracle# yum localinstall oracle-database-xe-18c-1.0-1.x86_64.rpm Setting up Local Package Process Examining oracle-database-xe-18c-1.0-1.x86_64.rpm: oracle-database-xe-18c-1.0-1.x86_64 Marking oracle-database-xe-18c-1.0-1.x86_64.rpm to be installed Resolving Dependencies --> Running transaction check ---> Package oracle-database-xe-18c.x86_64 0:1.0-1 will be installed --> Processing Dependency: file for package: oracle-database-xe-18c-1.0-1.x86_64 --> Processing Dependency: net-tools for package: oracle-database-xe-18c-1.0-1.x86_64 --> Processing Dependency: oracle-database-preinstall-18c for package: oracle-database-xe-18c-1.0-1.x86_64 --> Processing Dependency: /bin/sh for package: oracle-database-xe-18c-1.0-1.x86_64 --> Processing Dependency: /bin/sh for package: oracle-database-xe-18c-1.0-1.x86_64 --> Processing Dependency: /bin/sh for package: oracle-database-xe-18c-1.0-1.x86_64 --> Processing Dependency: /bin/sh for package: oracle-database-xe-18c-1.0-1.x86_64 --> Processing Dependency: /bin/sh for package: oracle-database-xe-18c-1.0-1.x86_64 --> Processing Dependency: /bin/sh for package: oracle-database-xe-18c-1.0-1.x86_64 --> Processing Dependency: /bin/sh for package: oracle-database-xe-18c-1.0-1.x86_64 --> Processing Dependency: /bin/sh for package: oracle-database-xe-18c-1.0-1.x86_64 --> Finished Dependency Resolution Error: Package: oracle-database-xe-18c-1.0-1.x86_64 (/oracle-database-xe-18c-1.0-1.x86_64) Requires: file Error: Package: oracle-database-xe-18c-1.0-1.x86_64 (/oracle-database-xe-18c-1.0-1.x86_64) Requires: net-tools Error: Package: oracle-database-xe-18c-1.0-1.x86_64 (/oracle-database-xe-18c-1.0-1.x86_64) Requires: oracle-database-preinstall-18c Error: Package: oracle-database-xe-18c-1.0-1.x86_64 (/oracle-database-xe-18c-1.0-1.x86_64) Requires: /bin/sh You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest 字段作为列表/数组。 您可以检查您的响应对象是否具有这样的字段吗?