How should I read the body text of the Response object ?

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.

How should I read the body text of the Response object ?

Postby loaded » Sat Jan 04, 2020 3:47 am

Hi All
I can get header information for Response object.
Code: Select all
procedure TForm_Main.Chromium1ResourceResponse(Sender: TObject;
  browser: ICefBrowser; frame: ICefFrame; request: ICefRequest;
  response: ICefResponse; out Result: Boolean);
 var
 i:integer;
 headerMap:ICefStringMultimap;
begin
  headerMap := TCefStringMultimapOwn.Create;
  response.GetHeaderMap(headerMap);
  if headerMap.Size <> 0 then for i := 0 to headerMap.Size - 1 do memo1.lines.add(PWideChar(headerMap.Key[i] + ': ' + headerMap.Value[i]));
  Result:=false;
end;

But;
I couldn't reach the body text. Is there an easier way to do this ?
Installing the spelling, google translate is used :)
User avatar
loaded
Newbie
 
Posts: 4
Joined: Wed Jan 01, 2020 3:05 am

Re: How should I read the body text of the Response object ?

Postby salvadordf » Sat Jan 04, 2020 4:16 am

Hi,

If you're using fpCEF then you should implement a string visitor but if you're using CEF4Delphi then call TChromium.RetrieveHTML and you will get the the body in the TChromium.OnTextResultAvailable event.

Notice that this is mainly a forum for C/C++ CEF developers.

Please, use the Lazarus forums for fpCEF questions :
https://forum.lazarus.freepascal.org/index.php

Or the CEF4Delphi forum if you use that component :
https://www.briskbard.com/forum/
Maintainer of the CEF4Delphi, WebView4Delphi, WebUI4Delphi and WebUI4CSharp projects.
User avatar
salvadordf
Expert
 
Posts: 129
Joined: Sun Dec 18, 2016 8:39 am
Location: Spain

Re: How should I read the body text of the Response object ?

Postby loaded » Sat Jan 04, 2020 4:34 am

salvadordf thank you for your idea.
I use Cef3 3.3029.1 and I am a member of the Lazarus Form.
Yeah, I may have asked the wrong place.
But there is a situation I'm stuck with;
Since, then, the One Who creates knows, surely the One Who knows will write.
I thought the best developers could solve it.
Installing the spelling, google translate is used :)
User avatar
loaded
Newbie
 
Posts: 4
Joined: Wed Jan 01, 2020 3:05 am


Return to Support Forum

Who is online

Users browsing this forum: yuki and 53 guests