cancel
Showing results for 
Search instead for 
Did you mean: 

How can I get Response get Body in Observer event?

SOLVED

How can I get Response get Body in Observer event?

In Magento 1 I can do the following:

 

$response = $observer->getEvent()->getControllerAction()->getResponse();
if(!$response) {
   return $this;
 }

$html = $response->getBody(); 

How can I do the same in Magento 2? 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: How can I get Response get Body in Observer event?

2 REPLIES 2

Re: How can I get Response get Body in Observer event?

How to get the HTTP response body for the current controller in Magento 2? https://mage2.pro/t/1056

Re: How can I get Response get Body in Observer event?