protected function prepareBody()
    {
        $body = $this->body;

        $result = $body;

        if ($this->isJson() && (is_array($body) || is_object($body))) {
            $result = json_encode(\pwf\helpers\ArrayHelper::toArray($body));
        }

        return $result;
    }