【问题标题】:Is there any way to fetch images using github's API?有没有办法使用 github 的 API 获取图像?
【发布时间】:2020-07-08 00:05:29
【问题描述】:

我正在获取 github 的 api 来显示我的项目。我有标题、描述、链接,但我不知道是否有可能从 readme.md 或其他地方获取图像?我需要它显示在标题和描述旁边。在 github 存储库中,我将它放在 dir src/images/image_1 等中。

【问题讨论】:

标签: javascript github-api fetch-api


【解决方案1】:

你好,路是

https://raw.githubusercontent.com/UserName/NameRepo/Branch/NameImg.png

UserName是仓库所有者的名字,NameRepo是仓库的名字,Branch是git的分支,可能有几个,但是默认是master,@ 987654326@是图片的名字,也必须跟扩展名。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-05-14
    • 2021-08-22
    • 2021-02-06
    • 1970-01-01
    相关资源
    最近更新 更多