Skip to content

Commit 95950b9

Browse files
committed
set basic auth
1 parent 6b668dd commit 95950b9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/HttpRequest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ public function __construct () {
2222
curl_setopt($this->_ch, CURLOPT_RETURNTRANSFER, true);
2323
}
2424

25+
public function setBasicAuth($username, $password) {
26+
curl_setopt($this->_ch, CURLOPT_USERPWD, $username . ":" . $password);
27+
}
28+
2529
public function setHeaders($headers = array())
2630
{
2731
$reformated = [];

0 commit comments

Comments
 (0)