首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何从issue id获取github issue url?

如何从issue id获取github issue url?
EN

Stack Overflow用户
提问于 2018-05-24 23:54:24
回答 1查看 272关注 0票数 0

我正在制作一个github问题应用程序,在显示特定repo的问题列表后,我想单击单个问题并导航到问题详细信息页面。

因此,我通过路由参数传递{issue.id}。现在,为了发出获取细节的axios GET请求,我想从给定的id中获取这个特定问题的url

有谁能给我带路吗?

EN

回答 1

Stack Overflow用户

发布于 2018-05-25 00:32:11

请检查此URL:

代码语言:javascript
复制
https://developer.github.com/v3/issues/#list-issues

Example:

https://api.github.com/repos/octocat/Hello-World/issues

https://api.github.com/repos/octocat/Hello-World/issues{/number}



Hope this helps.

回复示例:

代码语言:javascript
复制
[
  {
    "url": "https://api.github.com/repos/octocat/Hello-World/issues/404",
    "repository_url": "https://api.github.com/repos/octocat/Hello-World",
    "labels_url": "https://api.github.com/repos/octocat/Hello-World/issues/404/labels{/name}",
    "comments_url": "https://api.github.com/repos/octocat/Hello-World/issues/404/comments",
    "events_url": "https://api.github.com/repos/octocat/Hello-World/issues/404/events",
    "html_url": "https://github.com/octocat/Hello-World/issues/404",
    "id": 322291044,
    "number": 404,
    "title": "Internationalization",
    "user": {
      "login": "dgruntz",
      "id": 1516800,
      "avatar_url": "https://avatars0.githubusercontent.com/u/1516800?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/dgruntz",
      "html_url": "https://github.com/dgruntz",
      "followers_url": "https://api.github.com/users/dgruntz/followers",
      "following_url": "https://api.github.com/users/dgruntz/following{/other_user}",
      "gists_url": "https://api.github.com/users/dgruntz/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/dgruntz/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/dgruntz/subscriptions",
      "organizations_url": "https://api.github.com/users/dgruntz/orgs",
      "repos_url": "https://api.github.com/users/dgruntz/repos",
      "events_url": "https://api.github.com/users/dgruntz/events{/privacy}",
      "received_events_url": "https://api.github.com/users/dgruntz/received_events",
      "type": "User",
      "site_admin": false
    },
    "labels": [

    ],
    "state": "open",
    "locked": false,
    "assignee": null,
    "assignees": [

    ],
    "milestone": null,
    "comments": 0,
    "created_at": "2018-05-11T13:11:00Z",
    "updated_at": "2018-05-11T13:11:00Z",
    "closed_at": null,
    "author_association": "NONE",
    "body": "I miss internationalization support for this project. Will that ever be added?"
  } ]
票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50513538

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档