[英]curl: provide user and password for apache .htaccess file
I am using cURL
to test some RESTful APIs. 我正在使用
cURL
来测试一些RESTful API。 Some of these APIs are served from an Apache machine, and protected with user/password combination using simple .httaccess
files. 其中一些API由Apache机器提供,并使用简单的
.httaccess
文件通过用户/密码组合进行保护。
Is there a way to provide cURL with a username / password combination as arguments? 有没有办法为cURL提供用户名/密码组合作为参数?
您可以使用此curl命令,例如:
curl -A "Mozilla" -L 'http://user:password@localhost/api/someapi.php'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.