简体   繁体   English

如何从Github的REST API获取JSON响应?

[英]How can I get a JSON response from Github's REST API?

I'm trying to use this guide to get a list of all issues from a repository. 我正在尝试使用本指南从存储库中获取所有问题的列表。 For example, let's look at the facebook/react repository . 例如,让我们看一下facebook/react存储库

When I do a GET request to https://github.com/facebook/react/issues/ it just returns the web page, but what I want is a JSON with all the issues. 当我对https://github.com/facebook/react/issues/进行GET请求时,它只是返回网页,但是我想要的是带有所有问题的JSON。

How can I get a JSON response? 如何获得JSON响应?

You need to use the API's root endpoint , on the api subdomain: 您需要在api子域上使用API​​的根端点

GET https://api.github.com/repos/facebook/react/issues
            ^^^^

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM