Json GithubAPI中的blob_url、raw_url和contents_url之间有什么区别?
下面的示例显示了API调用的应答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
"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