Lines Matching refs:body

199      * @param  null      $body
204 public function performRequest(string $method, string $uri, ?array $params = [], $body = null, array $options = [], Transport $transport = null)
206 if ($body !== null) {
207 $body = $this->serializer->serialize($body);
224 'body' => $body,
300 $request['body'],
321 if (isset($response['body']) === true) {
322 $response['body'] = stream_get_contents($response['body']);
323 $this->lastRequest['response']['body'] = $response['body'];
328 // Skip 404 if succeeded true in the body (e.g. clear_scroll)
329 $body = $response['body'] ?? '';
330 if (strpos($body, '"succeeded":true') !== false) {
340 $response['body'] = $this->serializer->deserialize($response['body'], $response['transfer_stats']);
344 return isset($request['client']['verbose']) && $request['client']['verbose'] === true ? $response : $response['body'];
400 $this->log->debug('Request Body', array($request['body']));
412 $this->log->debug('Response', array($response['body']));
415 $curlCommand = $this->buildCurlCommand($request['http_method'], $uri, $request['body']);
420 'response' => $response['body'],
444 $this->log->debug('Request Body', array($request['body']));
457 $this->log->warning('Response', array($response['body']));
460 $curlCommand = $this->buildCurlCommand($request['http_method'], $uri, $request['body']);
648 private function buildCurlCommand(string $method, string $url, ?string $body): string
659 if (isset($body) === true && $body !== '') {
660 $curlCommand .= " -d '" . $body . "'";
679 $responseBody = $this->convertBodyToString($response['body'], $statusCode, $exception);
704 $responseBody = $response['body'];
737 private function convertBodyToString($body, int $statusCode, Exception $exception) : string
739 if (empty($body)) {
746 // if body is not string, we convert it so it can be used as Exception message
747 if (!is_string($body)) {
748 return json_encode($body);
750 return $body;
765 $error = $this->serializer->deserialize($response['body'], $response['transfer_stats']);
769 // $error is an array but we don't know the format, reuse the response body instead
771 return new $errorClass(json_encode($response['body']), (int) $response['status']);
786 $original = new $errorClass(json_encode($response['body']), $response['status']);
792 $original = new $errorClass(json_encode($response['body']), $response['status']);
802 $responseBody = $response['body'];