mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-31 12:43:14 +00:00
Add setDigestAuthentication to Curl class
Function setDigestAuthentication works mostly like setBasicAuthentication, except it set **CURLOPT_HTTPAUTH** to **CURLAUTH_DIGEST**. Furthermore it sets **CURLOPT_RETURNTRANSFER** to **true**.
This commit is contained in:
@@ -291,6 +291,13 @@ class Curl
|
||||
$this->setOpt(CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
|
||||
$this->setOpt(CURLOPT_USERPWD, $username . ':' . $password);
|
||||
}
|
||||
|
||||
public function setDigestAuthentication($username, $password = '')
|
||||
{
|
||||
$this->setOpt(CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
|
||||
$this->setOpt(CURLOPT_USERPWD, $username . ':' . $password);
|
||||
$this->setOpt(CURLOPT_RETURNTRANSFER, true);
|
||||
}
|
||||
|
||||
public function setCookie($key, $value)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user