Пример #1
0
 private function authenticateRequest(HttpRequest $request)
 {
     $body = JsonRpc\json_decode((string) $request->getBody()->getContents(), true);
     $body['auth'] = $this->auth_token;
     $json_body = JsonRpc\json_encode($body);
     $request = $request->withBody(Psr7\stream_for($json_body));
     return $request;
 }
Пример #2
0
 /**
  * {@inheritdoc}
  */
 public function createResponse($statusCode, array $headers = [], array $options = [])
 {
     $body = JsonRpc\json_encode($options);
     return new Response($statusCode, $headers, $body);
 }