{"id":302949,"date":"2020-05-03T15:00:34","date_gmt":"2020-05-03T15:00:34","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=302949"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=302949","title":{"rendered":"SOA \u043d\u0430 Laravel \u0438 JSON-RPC 2.0"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/499626\/\">SOA (\u0421\u0435\u0440\u0432\u0438\u0441-\u041e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430) \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u043f\u0443\u0442\u0451\u043c \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 \u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441\u043b\u0430\u0431\u043e-\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432. <br \/>  \u0414\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0432\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u041a\u043b\u0438\u0435\u043d\u0442 \u0438 \u0421\u0435\u0440\u0432\u0435\u0440.<br \/>  \u0410 \u0438\u0445 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0443\u0435\u043c \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440 <code>JSON-RPC 2.0<\/code>.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u041a\u043b\u0438\u0435\u043d\u0442<\/h4>\n<p>  \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u041a\u043b\u0438\u0435\u043d\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0441\u0430\u0439\u0442 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043d\u0435\u043a\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430. \u041a\u043b\u0438\u0435\u043d\u0442 \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044e \u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0421\u0435\u0440\u0432\u0435\u0440. <\/p>\n<p>  \u041d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 <code>JsonRpcClient<\/code><\/p>\n<pre><code class=\"php\">namespace ClientApp\\Services;  use GuzzleHttp\\Client; use GuzzleHttp\\RequestOptions;  class JsonRpcClient {     const JSON_RPC_VERSION = '2.0';      const METHOD_URI = 'data';      protected $client;      public function __construct()     {         $this-&gt;client = new Client([             'headers' =&gt; ['Content-Type' =&gt; 'application\/json'],             'base_uri' =&gt; config('services.data.base_uri')         ]);     }      public function send(string $method, array $params): array     {         $response = $this-&gt;client             -&gt;post(self::METHOD_URI, [                 RequestOptions::JSON =&gt; [                     'jsonrpc' =&gt; self::JSON_RPC_VERSION,                     'id' =&gt; time(),                     'method' =&gt; $method,                     'params' =&gt; $params                 ]             ])-&gt;getBody()-&gt;getContents();          return json_decode($response, true);     } } <\/code><\/pre>\n<p>  \u041d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <code>GuzzleHttp<\/code>, \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0435\u0435.<br \/>  \u0424\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0432\u043f\u043e\u043b\u043d\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 <code>POST<\/code> \u0437\u0430\u043f\u0440\u043e\u0441 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>GuzzleHttp\\Client<\/code>. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043d\u044e\u0430\u043d\u0441 \u0437\u0434\u0435\u0441\u044c \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<br \/>  \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 <code>JSON-RPC 2.0<\/code> \u0437\u0430\u043f\u0440\u043e\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u0435\u0442\u044c \u0432\u0438\u0434:<\/p>\n<pre><code class=\"json\">{     &quot;jsonrpc&quot;: &quot;2.0&quot;,      &quot;method&quot;: &quot;getPageById&quot;,     &quot;params&quot;: {         &quot;page_uid&quot;: &quot;f09f7c040131&quot;     },      &quot;id&quot;: &quot;54645&quot; } <\/code><\/pre>\n<p>  <\/p>\n<ul>\n<li><code>jsonrpc<\/code> \u0432\u0435\u0440\u0441\u0438\u044f \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430, \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u0430 \u00ab2.0\u00bb<\/li>\n<li><code>method<\/code> \u0438\u043c\u044f \u043c\u0435\u0442\u043e\u0434\u0430<\/li>\n<li><code>params<\/code> \u043c\u0430\u0441\u0441\u0438\u0432 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438<\/li>\n<li><code>id<\/code> \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0437\u0430\u043f\u0440\u043e\u0441\u0430<\/li>\n<\/ul>\n<p>  \u041e\u0442\u0432\u0435\u0442 <\/p>\n<pre><code class=\"json\">{     &quot;jsonrpc&quot;: &quot;2.0&quot;,     &quot;result&quot;: {         &quot;id&quot;: 2,         &quot;title&quot;: &quot;Index Page&quot;,         &quot;content&quot;: &quot;Content&quot;,         &quot;description&quot;: &quot;Description&quot;,         &quot;page_uid&quot;: &quot;f09f7c040131&quot;     },     &quot;id&quot;: &quot;54645&quot; } <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0441 \u0431\u044b\u043b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0441 \u043e\u0448\u0438\u0431\u043a\u043e\u0439, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c<\/p>\n<pre><code class=\"json\">{     &quot;jsonrpc&quot;: &quot;2.0&quot;,     &quot;error&quot;: {         &quot;code&quot;: -32700,         &quot;message&quot;: &quot;Parse error&quot;     },     &quot;id&quot;: &quot;null&quot; } <\/code><\/pre>\n<p>  <\/p>\n<ul>\n<li><code>jsonrpc<\/code> \u0432\u0435\u0440\u0441\u0438\u044f \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430, \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u0430 \u00ab2.0\u00bb<\/li>\n<li><code>result<\/code> \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043b\u0435 \u043f\u0440\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u041d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u0438 \u043e\u0448\u0438\u0431\u043a\u0438<\/li>\n<li><code>error<\/code> \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043b\u0435 \u043f\u0440\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u0438 \u043e\u0448\u0438\u0431\u043a\u0438. \u041d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435<\/li>\n<li><code>id<\/code> \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c<\/li>\n<\/ul>\n<p>  \u041e\u0442\u0432\u0435\u0442 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u0441\u0435\u0440\u0432\u0435\u0440, \u0442\u0430\u043a \u0447\u0442\u043e \u043c\u044b \u043a \u043d\u0435\u043c\u0443 \u0435\u0449\u0435 \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f.<\/p>\n<p>  \u0412 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u0441 \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442.<\/p>\n<pre><code class=\"php\">namespace ClientApp\\Http\\Controllers;  use App\\Services\\JsonRpcClient; use Illuminate\\Http\\Request; use Illuminate\\Support\\Facades\\Redirect;  class SiteController extends Controller {     protected $client;      public function __construct(JsonRpcClient $client)     {         $this-&gt;client = $client;     }      public function show(Request $request)     {         $data = $this-&gt;client-&gt;send('getPageById', ['page_uid' =&gt; $request-&gt;get('page_uid')]);          if (empty($data['result'])) {             abort(404);         }          return view('page', ['data' =&gt; $data['result']]);     }      public function create()     {         return view('create-form');     }      public function store(Request $request)     {         $data = $this-&gt;client-&gt;send('create', $request-&gt;all());          if (isset($data['error'])) {             return Redirect::back()-&gt;withErrors($data['error']);         }          return view('page', ['data' =&gt; $data['result']]);     } } <\/code><\/pre>\n<p>  \u0424\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u043e\u0442\u0432\u0435\u0442\u0430 JSON-RPC \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043b\u0435\u0433\u043a\u043e \u043f\u043e\u043d\u044f\u0442\u044c \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u043c \u043b\u0438 \u0431\u044b\u043b \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u043b\u0438\u0431\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u0435\u0441\u043b\u0438 \u043e\u0442\u0432\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0448\u0438\u0431\u043a\u0443. <\/p>\n<h4>\u0421\u0435\u0440\u0432\u0435\u0440<\/h4>\n<p>  \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0440\u043e\u0443\u0442\u0438\u043d\u0433\u0430. \u0412 \u0444\u0430\u0439\u043b <code>routes\/api.php<\/code> \u0434\u043e\u0431\u0430\u0432\u0438\u043c<\/p>\n<pre><code class=\"php\">Route::post('\/data', function (Request $request, JsonRpcServer $server, DataController $controller) {     return $server-&gt;handle($request, $controller); }); <\/code><\/pre>\n<p>  \u0412\u0441\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u0432\u0448\u0438\u0435 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <code>&lt;server_base_uri&gt;\/data<\/code> \u0431\u0443\u0434\u0443\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u044b \u043a\u043b\u0430\u0441\u0441\u043e\u043c <code>JsonRpcServer<\/code><\/p>\n<pre><code class=\"php\">namespace ServerApp\\Services;  class JsonRpcServer {     public function handle(Request $request, Controller $controller)     {                 try {             $content = json_decode($request-&gt;getContent(), true);              if (empty($content)) {                 throw new JsonRpcException('Parse error', JsonRpcException::PARSE_ERROR);             }             $result = $controller-&gt;{$content['method']}(...[$content['params']]);              return JsonRpcResponse::success($result, $content['id']);         } catch (\\Exception $e) {             return JsonRpcResponse::error($e-&gt;getMessage());         }     } } <\/code><\/pre>\n<p>  \u041a\u043b\u0430\u0441\u0441 <code>JsonRpcServer<\/code> \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0443\u0436\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0441 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438. \u0418 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0442\u0432\u0435\u0442 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441\u043e\u043c <code>JsonRpcResponse<\/code> \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 <code>JSON-RPC 2.0<\/code> \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u0432\u044b\u0448\u0435.<\/p>\n<pre><code class=\"php\">use ServerApp\\Http\\Response;  class JsonRpcResponse {     const JSON_RPC_VERSION = '2.0';      public static function success($result, string $id = null)     {         return [             'jsonrpc' =&gt; self::JSON_RPC_VERSION,             'result'  =&gt; $result,             'id'      =&gt; $id,         ];     }      public static function error($error)     {         return [             'jsonrpc' =&gt; self::JSON_RPC_VERSION,             'error'  =&gt; $error,             'id'      =&gt; null,         ];     } } <\/code><\/pre>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440.<\/p>\n<pre><code class=\"php\">namespace ServerApp\\Http\\Controllers;  class DataController extends Controller {     public function getPageById(array $params)     {         $data = Data::where('page_uid', $params['page_uid'])-&gt;first();          return $data;     }      public function create(array $params)     {         $data = DataCreate::create($params);          return $data;     } } <\/code><\/pre>\n<p>  \u041d\u0435 \u0432\u0438\u0436\u0443 \u0441\u043c\u044b\u0441\u043b\u0430 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440, \u0432\u043f\u043e\u043b\u043d\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b. \u0412 \u043a\u043b\u0430\u0441\u0441\u0435 <code>DataCreate<\/code> \u0441\u043e\u0431\u0440\u0430\u043d\u0430 \u0432\u0441\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u0435\u0439 \u0441 \u0432\u044b\u0431\u0440\u043e\u0441\u043e\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0433\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f.<\/p>\n<h3>\u0412\u044b\u0432\u043e\u0434<\/h3>\n<p>  \u042f \u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u043d\u0435 \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u0441\u0430\u043c\u0438\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0430 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0430\u043a\u0446\u0435\u043d\u0442 \u043d\u0430 \u0438\u0445 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438.<br \/>  \u041f\u0440\u043e \u043f\u043b\u044e\u0441\u044b \u0438 \u043c\u0438\u043d\u0443\u0441\u044b JSON-RPC \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u0441\u0442\u0430\u0442\u044c\u0435, \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u043e\u0441\u0442\u0430\u0432\u043b\u044e \u043d\u0438\u0436\u0435. \u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0430\u043a\u0442\u0443\u0430\u043b\u0435\u043d, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u0444\u043e\u0440\u043c. <\/p>\n<h3>\u0421\u0441\u044b\u043b\u043a\u0438<\/h3>\n<p>  <\/p>\n<ul>\n<li>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u0440\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0447\u0438\u0442\u0430\u0435\u043c \u0437\u0434\u0435\u0441\u044c <a href=\"https:\/\/www.jsonrpc.org\/specification\" rel=\"nofollow\">jsonrpc.org\/specification<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/441854\/\">REST? \u0412\u043e\u0437\u044c\u043c\u0438\u0442\u0435 \u0442\u0443\u043f\u043e\u0439 JSON-RPC<\/a> \u0441\u0442\u0430\u0442\u044c\u044f \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0430\u044f \u043f\u043b\u044e\u0441\u044b \u0438 \u043c\u0438\u043d\u0443\u0441\u044b JSON-RPC<\/li>\n<\/ul>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/499626\/\"> https:\/\/habr.com\/ru\/post\/499626\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/499626\/\">SOA (\u0421\u0435\u0440\u0432\u0438\u0441-\u041e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430) \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u043f\u0443\u0442\u0451\u043c \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 \u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441\u043b\u0430\u0431\u043e-\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432. <br \/>  \u0414\u043b\u044f \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0432\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u041a\u043b\u0438\u0435\u043d\u0442 \u0438 \u0421\u0435\u0440\u0432\u0435\u0440.<br \/>  \u0410 \u0438\u0445 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0443\u0435\u043c \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440 <code>JSON-RPC 2.0<\/code>.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-302949","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/302949","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=302949"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/302949\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=302949"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=302949"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=302949"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}