Tag Archives: if

GitHub 提供更輕量的 Commit Reference SHA-1 API

GitHub 提供了新的 API 讓 client 可以更省網路資源,同時 GitHub 本身也可以省下 query。雖然是 Preview 期間,但已經有專案開始用了:「Commit Reference SHA-1 Preview Period」。 本來是這樣抓: curl "https://api.github.com/repos/Homebrew/homebrew/commits/master" \ -H "Accept: application/vnd.github.chitauri-preview+sha" 現在則可以加上 If-None-Match: curl "https://api.github.com/repos/Homebrew/homebrew/commits/master" \ -H "Accept: application/vnd.github.chitauri-preview+sha" \ -H "If-None-Match: \"814412cfbd631109df337e16c807207e78c0d24e\"" 當本地與遠端的 SHA-1 值一樣時會收到 304,而且不會吃 rate limit … Continue reading

Posted in Computer, Murmuring, Network, Programming, WWW | Tagged , , , , , , , , , , | Leave a comment