I am trying to get data from service. Here is my code:
$opts = array(
'http'=>array(
'header'=> 'Authorization: Basic '.base64_encode('$uN:$pW')
)
);
$context = stream_context_create($opts);
$result = file_get_contents(
'https://.........',
false,
$context
);
This code causes exception -
Request filed. Unauthorized 401
I tried access this link from browser. Browser asked for credentials and requested with header "Authorization: NTLM ....". I replaced "Basic" with "NTLM", but nothing changed and code keeps fail. Maybe someone know where is the problem?