コード例 #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
ファイル: MessageFactory.php プロジェクト: yashb/generator
 /**
  * {@inheritdoc}
  */
 public function createResponse($statusCode, array $headers = [], array $options = [])
 {
     $body = JsonRpc\json_encode($options);
     return new Response($statusCode, $headers, $body);
 }