Page 1 of 1

CefResponse - how to get response content ?

PostPosted: Thu Oct 01, 2015 8:14 am
by silver
Inside this function

Code: Select all
bool OnResourceResponse(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame,
      CefRefPtr<CefRequest> request, CefRefPtr<CefResponse> response)


I want the response content/html whatever was send by server. How ?

Re: CefResponse - how to get response content ?

PostPosted: Thu Oct 01, 2015 8:19 am
by magreenblatt
If you just want the HTML after the page is loaded you can use CefFrame::GetSource. Otherwise, see https://bitbucket.org/chromiumembedded/cef/issues/515

Re: CefResponse - how to get response content ?

PostPosted: Thu Oct 01, 2015 8:26 am
by silver
magreenblatt wrote:If you just want the HTML after the page is loaded you can use CefFrame::GetSource. Otherwise, see https://bitbucket.org/chromiumembedded/cef/issues/515


I want the html right away in that OnResourceResponse handler.
Issue 515 seems to be too much work.

Something like this would be great.

Code: Select all
bool OnResourceResponse(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame,
      CefRefPtr<CefRequest> request, CefRefPtr<CefResponse> response)
{
    string response_content = response->GetContent();
}

Re: CefResponse - how to get response content ?

PostPosted: Thu Oct 01, 2015 8:30 am
by magreenblatt
silver wrote:Something like this would be great.

Sure. But that doesn't exist.