2017-04-06 24 views
0

我剛開始使用github api從我們的倉庫中提取問題記錄。 當我打,curl url獲取我的倉庫中的問題的json文件

curl -k -H "Content-Type: application/json" https://2b9e36bvb9e36b82d38b9c0ab2b9e36b82d3:[email protected]/newlands/hello-world/issues 

我得到以下輸出。

> <html><body>You are being <a 
> href="https://rnd.git.corp/login?return_to=https%3A%2F%2Frnd.git.corp%2Fnewlands%2Fhello-world%2Fissues">redirected</a>.</body></html> 

我的curl命令有什麼問題嗎?理想情況下應該根據git api文檔在我的存儲庫中打印問題列表。感謝任何幫助。

回答

0

如果rnd.git.corp是根據URL來api.github.com,你也許只是錯過/repos,像https://rnd.git.corp/repos/newlands/hello-world/issues

+0

'https:// rnd.git.corp/newlands/hello-world'這是我的respositry網址,與api.github.com不同。 – NewLands

+0

這正是我所說的,問題可能是。 'https:// github.com/Vampire/teamcity-sourceforge/issues'是我的一個網絡版軟件庫問題,'https:// api.github.com/Vampire/teamcity-sourceforge/issues'是一個無效的URL和'https:// api.github.com/repos/Vampire/teamcity-sourceforge/issues'是將URL作爲JSON字符串獲取的API URL。可能與GitHub Enterprise類似。 – Vampire

+0

錯過了告訴你,我嘗試在URL中添加/ repos,即「https:// rnd.git.corp/repos/newlands/hello-world/issues」。它仍然是一樣的。我錯過了什麼? – NewLands

0

感謝@Vampire。我想我得到了解決方案。我們的組織安裝了enterprise github,其API訪問URL略爲different

所以,GitHub的企業的URL應該是這樣的,

https://rnd.git.corp/api/v3/newlands/hello-world/issues 

如果有人想增加更多或更正這個答案,感覺很自由。和平!