curl: provide user and password for apache .htaccess file

前端 未结 2 581
情书的邮戳
情书的邮戳 2021-02-12 11:14

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

2条回答
  •  长发绾君心
    2021-02-12 11:42

    You can use this curl command for example:

    curl -A "Mozilla" -L 'http://user:password@localhost/api/someapi.php'
    

提交回复
热议问题