Set the raw body of the response.

@param string $body The new raw body.
160276
public function setRawBody(string $body) {
        $this->rawBody = $body;
        $this->body = null;
        return $this;
    }
254645
public function body($body = null)
    {
        if ($body !== null) {
            $this->_body = $body;

            return $this;
        }

        return $this->_body;
    }
439684
public function setResponse($response)
    {
        $xml = simplexml_load_string($response);
        if (!empty($xml->error)) {
            $this->message = (string) $xml->error;
        }
    }
799038
public void setBody(Map<String, Object> body) {
        this.id = (String) body.get(CouchConstants._id);
        this.bodyBytes = JSONUtils.serializeAsBytes(body);
        contentLength += bodyBytes.length;
    }
1307085
public function setBody($body) : Response
    {
        if (is_null($body) || is_scalar($body)) {
            $this->body = (string) $body;

            return $this;
        }

        $prefix = 'Body must be null or scalar, ';
        $suffix = gettype($body) . ' given.';

        throw new \InvalidArgumentException("{$prefix}{$suffix}");
    }
1129465
public function setBody($body)
    {
        if (
            !$this->checkFixedArray($body, 2) ||
            !is_numeric($body[0]) ||
            !is_array($body[1])
        ) {
            throw new InvalidResponseException($this->command, $body);
        }

        parent::setBody($body);
    }
93434
private function setBody(TransportRequestInterface $transportRequest, $body)
    {
        if (null !== $body) {
            $transportRequest->setBody($body);
        }

        return $transportRequest;
    }
491840
public function setBody(Body $body)
    {
        $this->body = $body;
        $this->setAllHeaders($body->getHeaders());
        $this->setStatus($body->getStatusCode());

        return $this;
    }
822795
public function post($body)
    {
        $curl = $this->createCurl();

        curl_setopt($curl, CURLOPT_POST, true);
        curl_setopt($curl, CURLOPT_POSTFIELDS, $body);

        return $this->execute($curl);
    }
958461
public function setRawResponse($response)
    {
        $parts = explode("\r\n\r\n", $response);

        if (count($parts) == 2) {
            $matches = array();
            $this->responseBody = $parts[1];

            if (preg_match_all(
                '/(HTTP\/[1-9]\.[0-9]\s+(?<statusCode>\d+)\s+(?<statusMessage>.*)'.
                        "|(?<headerName>[^:]+)\\s*:\\s*(?<headerValue>.*))\r\n/m",
                    $parts[0], $matches)) {
                foreach ($matches['statusCode'] as $offset => $match) {
                    if (!empty($match)) {
                        $this->statusCode = (int) $match;
                        $this->statusMessage = $matches['statusMessage'][$offset];
                        break;
                    }
                }

                foreach ($matches['headerName'] as $offset => $name) {
                    if (!empty($name)) {
                        $key = strtolower($name);
                        $header = array('name' => $name,
                            'value' => $matches['headerValue'][$offset],
                        );

                        if (isset($this->responseHeader[$key])) {
                            if (isset($this->responseHeader[$key]['name'])) {
                                $this->responseHeader[$key] = array(
                                    $this->responseHeader[$key],
                                );
                            }

                            $this->responseHeader[$key][] = $header;
                        } else {
                            $this->responseHeader[$key] = $header;
                        }
                    }
                }
            }
        } else {
            $this->responseBody = $response;
        }
    }
846211
public function setTextBody($text) {
    if (!is_string($text)) {
      $error = sprintf("Plain text given is not a string (Actual type: %s).",
                       gettype($text));
      throw new \InvalidArgumentException($error);
    }
    $this->message->setTextbody($text);
  }
1224972
@Internal
    public void setBody(T body) {
        this.body = () -> Optional.ofNullable(body);
        this.convertedBodies.clear();
    }
625166
public function parse($body)
    {
        $responseClass = $this->responseHandler;
        $response = new $responseClass();
        $response->setCommand($this);
        $response->setBody($body);
        return $response->parse();
    }
1367644
public function post($url, $body)
    {
        $this->addHeader('Content-Type', $this->getContentType());

        if (!is_string($body)) {
            $body = json_encode($body);
        }

        $this->initializeRequest();

        curl_setopt($this->curl, CURLOPT_CUSTOMREQUEST, 'POST');
        curl_setopt($this->curl, CURLOPT_URL, $url);
        curl_setopt($this->curl, CURLOPT_POST, true);
        curl_setopt($this->curl, CURLOPT_PUT, false);
        curl_setopt($this->curl, CURLOPT_HTTPGET, false);
        curl_setopt($this->curl, CURLOPT_POSTFIELDS, $body);
        curl_exec($this->curl);

        return $this->handleResponse();
    }
1318362
public function setBody($body)
    {
        $node = $this->getBody(false);
        if(!$node){
            $node = $this->createElement('body');
            $this->doc->appendChild($node);
        }
        $node->nodeValue = htmlspecialchars($body);
    }
399588
public MockResponse setBody(String body) {
        try {
            return setBody(body.getBytes("UTF-8"));
        } catch (UnsupportedEncodingException e) {
            throw new AssertionError();
        }
    }
1077214
public function setBody(string $body, string $contentType = 'text/html')
    {
        $this->setHeader('Content-Type', $contentType);
        $this->body = $body;
        return $this;
    }