curl: provide user and password for apache .htaccess file

前端 未结 2 576
情书的邮戳
情书的邮戳 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

    Use this curl option for the commandline

    -u "User:Password"
    

    More details about this parameter can be found from here.

    0 讨论(0)
  • 2021-02-12 11:42

    You can use this curl command for example:

    curl -A "Mozilla" -L 'http://user:password@localhost/api/someapi.php'
    
    0 讨论(0)
提交回复
热议问题