Curl不会使用GitHub API提示我输入密码 [英] cURL won't prompt me for password using GitHub API
本文介绍了Curl不会使用GitHub API提示我输入密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在关注GitHub's tutorial使用他们的API。在我的Git Bash命令提示符下,我键入以下内容
curl -i https://api.github.com/users/defunkt
这就像它应该做的那样引入了JSON。但是,当我键入
curl -i -u your_username https://api.github.com/users/defunkt
它只是打印一个新行,就好像它在等待我完成命令之类的。我需要按CTRL C
才能退出。我也尝试了不同的变种,
curl -i -u "your_username" https://api.github.com/users/defunkt
curl -i --user your_username https://api.github.com/users/defunkt
curl -i --user "your_username" https://api.github.com/users/defunkt
curl -i -user your_username https://api.github.com/users/defunkt
curl -i -user "your_username" https://api.github.com/users/defunkt
而且什么都不起作用。我做错了什么?
推荐答案
这是一个已知问题(https://github.com/curl/curl/issues/573)。
解决方法:在curl命令前面加上"winpty"。即winpty curl ...
这篇关于Curl不会使用GitHub API提示我输入密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文