I have created a method that I want to expose to outside world. My application is controlled by ACL. so to consume restful service you send the data in get or post to that method via url.
http://mysite.com?action=this&data=this etc
but I think I need to send the username and password too with it dont I? Also if I do, then where do I add it?
** WHAT HAVE I TRIED **
<?php
$ch = curl_init("http://test.local/sites/loginData");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_USERPWD, 'user:password');
// sending username and pwd.
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_USERAGENT, 'Sample Code');
curl_setopt($curl, CURLINFO_HEADER_OUT, true);
$output = curl_exec($ch);
print_r($output);
curl_close($ch);
echo '<br><br>';
echo $output;
?>
but it doesnt show me any response