Skip to content

Instantly share code, notes, and snippets.

@Rheola
Created February 22, 2019 13:26
Show Gist options
  • Save Rheola/83ce792fb055ed2e117b5e05b3f90119 to your computer and use it in GitHub Desktop.
Save Rheola/83ce792fb055ed2e117b5e05b3f90119 to your computer and use it in GitHub Desktop.
<?php
$ip = 'dev.uc-itcom.ru';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://' . $ip . '/app/index.php/gateway/ofdApi/sign');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, '<xml>
<login>semenov_278</login>
<password>x8XUo6z0</password>
<base64Data>cGFzc3dvcmQ=</base64Data>
<type>CAdES</type>
<idItk>278</idItk>
</xml>');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
$out = curl_exec($ch);
if ($out === false) {
$errot = curl_error($ch);
throw new Exception('Ошибка CURL: ' . curl_error($ch), 500);
}
$data = simplexml_load_string($out);
var_dump($data->result);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment