curl:为 apache .htaccess 文件提供用户和密码 [英] curl: provide user and password for apache .htaccess file

查看:28
本文介绍了curl:为 apache .htaccess 文件提供用户和密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 cURL 来测试一些 RESTful API.其中一些 API 由 Apache 机器提供,并使用简单的 .httaccess 文件通过用户/密码组合进行保护.

I am using cURL to test some RESTful APIs. Some of these APIs are served from an Apache machine, and protected with user/password combination using simple .httaccess files.

有没有办法为 cURL 提供用户名/密码组合作为参数?

Is there a way to provide cURL with a username / password combination as arguments?

推荐答案

在命令行中使用此 curl 选项

Use this curl option for the commandline

-u "User:Password"

可以从此处找到有关此参数的更多详细信息.

More details about this parameter can be found from here.

这篇关于curl:为 apache .htaccess 文件提供用户和密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆