Skip to content
Michael Pierce edited this page Oct 18, 2013 · 2 revisions

Welcome to the PHPBrowserMobProxy wiki!

I had a requirement to capture header content. With BMP 0.8-beta this is now possible.

To accomplish this, I altered your new_har function:

function new_har($label = '') { //$data = "initialPageRef=" . $label; //Beta 8 has the ability to capture content, so recode this part $data = $this->encode_array(array("initialPageRef" => $label, "captureContent" => "true","captureHeaders" => "true","captureBinaryContent" => "true")); $response = Requests::put("http://" . $this->browsermob_url . "/proxy/" . $this->port . "/har", array(), $data); return $response; }

Your code was useful, and saved me time, so I wanted to give back

Clone this wiki locally