I have been trying to use the Curl examples on cloundant using PHP. However, nothing I try works. All I want to do is simply read, write, search data on cloundant using PHP. However, there doesn't seem to be a simple way for a beginning developer to do this.
Code here:
//Get DB's
$returned_content = get_data('https://**InstanceName**:**Password**@**InstanceName**.cloudant.com/_all_dbs');
function get_data($url)
{
$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
The error I get is:
{"error":"unauthorized","reason":"Name or password is incorrect"}