Пример #1
0
 protected function process($request, $operation, $jsonHelper)
 {
     $jsonRequest = $this->buildRequest($request, $operation, $jsonHelper);
     echo '<div class="col-lg-10 col-lg-offset-1"><div class="alert alert-info" role="alert"><strong>Raw Request</strong> ' . $jsonRequest . '</div></div>';
     $headers = $this->buildHeaders($jsonRequest);
     $jsonResponse = RestClient::sendRequest($this->config, $jsonRequest, $headers);
     $isValidResponse = strpos($jsonResponse, 'responseData');
     if ($isValidResponse === FALSE) {
         echo '<div class="col-lg-10 col-lg-offset-1"><div class="alert alert-danger" role="alert"><strong>Oh snap!</strong> Something Wrong The response is ' . $jsonResponse . ' </div></div>';
     } else {
         echo '<div class="col-lg-10 col-lg-offset-1"><div class="alert alert-success" role="alert"><strong>Raw Response</strong> ' . $jsonResponse . '</div></div>';
     }
     return $this->buildResponse($jsonResponse, $jsonHelper);
 }