You are here

function HTTP_Request::setBasicAuth in Flickr API 5

Sets basic authentication parameters

Parameters

string Username:

string Password:

1 call to HTTP_Request::setBasicAuth()
HTTP_Request::setURL in phpFlickr/PEAR/HTTP/Request.php
Sets the URL to be requested

File

phpFlickr/PEAR/HTTP/Request.php, line 455

Class

HTTP_Request
Class for performing HTTP requests

Code

function setBasicAuth($user, $pass) {
  $this->_user = $user;
  $this->_pass = $pass;
  $this
    ->addHeader('Authorization', 'Basic ' . base64_encode($user . ':' . $pass));
}