Found a topic Authorization using CURL but it is not clear. I have an address where I need to log in, I want to authorize through because of the domain. (if you go to the site via a browser, it will automatically recognize you, if you go in locally forgive, enter the login domen \ user). The essence of the problem is that I send a POST request to the specified address, an example, but the server says you are not authorized {"Message": "Authorization has been denied for this request. How can I save the session at the beginning and push the request already?
<?php $curl = curl_init("https://helpdesk.*****.ru:80**/inframanager/sdApi/registerCallEngineer"); // Передача данных осуществляется методом POST curl_setopt($curl, CURLOPT_POST, 1); // Задаем POST-данные $data = 'UserID=b105380a-389c-4c1d-842f-b5ce4c229d5b62197abe66de'; curl_setopt($curl, CURLOPT_POSTFIELDS, $data); // Выполняем запрос и выводим ответ в браузер curl_exec($curl); // Закрываем CURL соединение curl_close($curl); ?>