How can I get headers of the URL from chrome-php

116 views Asked by At

I am using chrome-php I want to get the header from the response Is there any way I can get it? Here is how I am trying to implement the functionality ...

$browserFactory = new BrowserFactory('chromium-browser');

// starts headless chrome
$browser = $browserFactory->createBrowser([
    'noSandbox' => true,
    'debugLogger' => 'php://stdout',
]);

try {
            
    $page = $browser->createPage();
    $page->navigate($url)->waitForNavigation();

    info([$page->getHtml()]);

finally {
    $browser->close();
}
0

There are 0 answers