protected function createRequestFromLog($requestLog)
    {
        if (strpos($requestLog, "\n\n")) {
            list($head, $content) = explode("\n\n", $requestLog, 2);
        } else {
            $head = $requestLog;
            $content = null;
        }

        $headers = explode("\n", $head);
        $main = array_shift($headers);
        list($method, $url) = explode(' ', $main, 2);

        return $this->panel->getHttpClient()->createRequest()
            ->setMethod($method)
            ->setUrl($url)
            ->setHeaders($headers)
            ->setContent($content);
    }
protected function createRequestFromLog($requestLog)
    {
        if (strpos($requestLog, "\n\n")) {
            list($head, $content) = explode("\n\n", $requestLog, 2);
        } else {
            $head = $requestLog;
            $content = null;
        }

        $headers = explode("\n", $head);
        $main = array_shift($headers);
        list($method, $url) = explode(' ', $main, 2);

        return $this->panel->getHttpClient()->createRequest()
            ->setMethod($method)
            ->setUrl($url)
            ->setHeaders($headers)
            ->setContent($content);
    }
protected function createRequestFromLog ( $ requestLog ) { if ( strpos ( $ requestLog , "\n\n" ) ) { list ( $ head , $ content ) = explode ( "\n\n" , $ requestLog , 2 ) ; } else { $ head = $ requestLog ; $ content = null ; } $ headers = explode ( "\n" , $ head ) ; $ main = array_shift ( $ headers ) ; list ( $ method , $ url ) = explode ( ' ' , $ main , 2 ) ; return $ this -> panel -> getHttpClient ( ) -> createRequest ( ) -> setMethod ( $ method ) -> setUrl ( $ url ) -> setHeaders ( $ headers ) -> setContent ( $ content ) ; }
Creates an HTTP request instance from log entry.
@param string $requestLog HTTP request log entry
@return \yii\httpclient\Request request instance.
@throws \yii\base\InvalidConfigException
Creates an HTTP request instance from log entry .