Last updated 4 months ago
The formats of requests and responses to the API comply with the specification .
The method of dispatch is always POST
POST
Query headers should always contain
Content-type: text/json; charset=utf-8;
JSON document encoding: UTF-8
UTF-8
http://lk.mysmpp.ru
<?php // JSON-document $src = json_encode([ "login" => "login", "password" => "password" ]); // server address $href = 'http://server/script.php'; $ch = curl_init(); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: text/json; charset=utf-8')); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CRLF, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $src); curl_setopt($ch, CURLOPT_URL, $href); $result = curl_exec($ch); curl_close($ch); echo $result;