yii\httpclient\debug\RequestExecuteAction::run PHP Method

run() public method

public run ( string $seq, string $tag, boolean $passthru = false ) : Response
$seq string
$tag string
$passthru boolean whether to send response to the browser or render it as plain text
return yii\web\Response
    public function run($seq, $tag, $passthru = false)
    {
        $this->controller->loadData($tag);
        $timings = $this->panel->calculateTimings();
        if (!isset($timings[$seq])) {
            throw new HttpException(404, 'Log message not found.');
        }
        $requestInfo = $timings[$seq]['info'];
        $httpRequest = $this->createRequestFromLog($requestInfo);
        $httpResponse = $httpRequest->send();
        $httpResponse->getHeaders()->get('content-type');
        $response = new Response(['format' => Response::FORMAT_RAW]);
        if ($passthru) {
            foreach ($httpResponse->getHeaders() as $name => $value) {
                $response->getHeaders()->set($name, $value);
            }
            $response->content = $httpResponse->content;
            return $response;
        }
        $response->getHeaders()->add('content-type', 'text/plain');
        $response->content = $httpResponse->toString();
        return $response;
    }
RequestExecuteAction