CefResponse - how to get response content ?

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

CefResponse - how to get response content ?

Postby silver » Thu Oct 01, 2015 8:14 am

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 ?
User avatar
silver
Techie
 
Posts: 48
Joined: Tue Feb 24, 2015 5:39 am

Re: CefResponse - how to get response content ?

Postby magreenblatt » Thu Oct 01, 2015 8:19 am

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
magreenblatt
Site Admin
 
Posts: 9976
Joined: Fri May 29, 2009 6:57 pm

Re: CefResponse - how to get response content ?

Postby silver » Thu Oct 01, 2015 8:26 am

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();
}
User avatar
silver
Techie
 
Posts: 48
Joined: Tue Feb 24, 2015 5:39 am

Re: CefResponse - how to get response content ?

Postby magreenblatt » Thu Oct 01, 2015 8:30 am

silver wrote:Something like this would be great.

Sure. But that doesn't exist.
magreenblatt
Site Admin
 
Posts: 9976
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 34 guests