Hi Guys, my site call a .js file and return to me a JSON, exist some way to get this JSON in OnResourceResponse event. MiniBrowser can get the headers with this code, but i need get the JSON result, exist some way to do that?
Thanks from some help.
procedure TMiniBrowserFrm.Chromium1ResourceResponse(Sender: TObject;
const browser: ICefBrowser; const frame: ICefFrame;
const request: ICefRequest; const response: ICefResponse;
out Result: Boolean);
begin
Result := False;
if Chromium1.IsSameBrowser(browser) and (frame <> nil) and frame.IsMain and
frame.IsValid then
InspectResponse(response);
end;
procedure TMiniBrowserFrm.InspectResponse(const aResponse: ICefResponse);
var
TempHeaderMap: ICefStringMultimap;
i, j: Integer;
begin
if (aResponse <> nil) then
begin
FResponse.Clear;
TempHeaderMap := TCefStringMultimapOwn.Create;
aResponse.GetHeaderMap(TempHeaderMap);
i := 0;
j := TempHeaderMap.Size;
while (i < j) do
begin
FResponse.Add(TempHeaderMap.Key + '=' + TempHeaderMap.value);
inc(i);
end;
end;
end;
Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
Resource Response
Re: Resource Response
You need to look at the examples, there is no simpler example(
demo - ResponseFilterBrowser
demo - ResponseFilterBrowser
- salvadordf
- Posts: 4573
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Resource Response
As Dilfich said, the ResponseFilterBrowser demo will always get the downloaded contents.
If you know the details of the request perhaps you can simulate it and use the URLRequest demo which is easier.
If you know the details of the request perhaps you can simulate it and use the URLRequest demo which is easier.
Re: Resource Response
Ah not always, I for example did to only POST receive, can be perhaps and on filter of links do. The complexity is one, it is a construction, it is not always convenient for such a banal task.
If there was a procedure\function in the component, it would be convenient for sure, because it is obvious that this is in demand.
If there was a procedure\function in the component, it would be convenient for sure, because it is obvious that this is in demand.
