I am calling rest api using file_get_contents with basic authentication. This request is working fine in Postman, but it is responding 404 with file_get_contents.
$options = array(
'http' => array(
'method' => 'POST',
'content' => json_encode($data),
'header' => "Content-Type: application/json
Authorization: Basic " . base64_encode('username:password') . "
",
),
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);