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
.httaccess
You can use this curl command for example:
curl -A "Mozilla" -L 'http://user:password@localhost/api/someapi.php'