Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Json GithubAPI中的blob_url、raw_url和contents_url之间有什么区别?_Json_Git_Api_Rest_Github - Fatal编程技术网

Json GithubAPI中的blob_url、raw_url和contents_url之间有什么区别?

Json GithubAPI中的blob_url、raw_url和contents_url之间有什么区别?,json,git,api,rest,github,Json,Git,Api,Rest,Github,下面的示例显示了API调用的应答 "files": [ { "sha": "bbcd538c8e72b8c175046e27cc8f907076331401", "filename": "file1.txt", "status": "added", "additions": 10

下面的示例显示了API调用的应答

  "files": [
    {
      "sha": "bbcd538c8e72b8c175046e27cc8f907076331401",
      "filename": "file1.txt",
      "status": "added",
      "additions": 103,
      "deletions": 21,
      "changes": 124,
      "blob_url": "https://github.com/octocat/Hello-World/blob/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt",
      "raw_url": "https://github.com/octocat/Hello-World/raw/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt",
      "contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/file1.txt?ref=6dcb09b5b57875f334f61aebed695e2e4193db5e",
      "patch": "@@ -132,7 +132,7 @@ module Test @@ -1000,7 +1000,7 @@ module Test"
    }
  ]
现在我想使用答案的单个文件的内容。
我应该从3个链接中选择哪一个

  • blub_url
  • 原始url
  • 目录

有什么区别?什么意思是为了什么目的?

内容\u url
one(from)支持

raw_url
one是第一种媒体类型的快捷方式

blob_url
one仅用于查看,并将该文件的内容存储在git repo中,而不考虑媒体类型

application/vnd.github.VERSION.raw
application/vnd.github.VERSION.html