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

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

问题描述

我使用 卷曲 以测试一些基于REST的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.

有没有一种方法,以提供卷曲的用户名/密码组合作为参数?

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

推荐答案

在命令行使用此卷曲选项​​

Use this curl option for the commandline

-u "User:Password"

有关此参数的更多细节可以发现,从这里

More details about this parameter can be found from here.

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

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