Can not get full response to all request link
Posted: Mon May 27, 2024 11:57 am
Hi
In one of my applications, I get every link of requests, and I want to get all response to those requests.
I use the ability to inject responses with CEF, and I get a complete response to every request.
But I don't get all the responses with Webview2, what am I missing?
In one of my applications, I get every link of requests, and I want to get all response to those requests.
I use the ability to inject responses with CEF, and I get a complete response to every request.
Code: Select all
TempHeaderMap := TCefStringMultimapOwn.Create;
aResponse.GetHeaderMap(TempHeaderMap); //all of responses to every request
Code: Select all
procedure TfRequestCon.WVBrowser1WebResourceResponseReceived(Sender: TObject;
const aWebView: ICoreWebView2;
const aArgs: ICoreWebView2WebResourceResponseReceivedEventArgs);
var
vIRRRP: ICoreWebView2WebResourceResponseView;
vIRRRPHead: ICoreWebView2HttpResponseHeaders;
vIterator: ICoreWebView2HttpHeadersCollectionIterator;
vN, vV: PWideChar;
vH: integer;
v: HRESULT;
begin
aArgs.Get_Response(vIRRRP);
vIRRRP.Get_Headers(vIRRRPHead);
if vIRRRPHead = nil then exit;
vIRRRPHead.GetIterator(vIterator);
v := 0;
while vIterator.Get_HasCurrentHeader(vH) = v do
begin
vIterator.GetCurrentHeader(vN, vV);
Memo1.Lines.Add(vN + ': ' + vV);
v := vIterator.MoveNext(vH);
if vH = 0 then
break;
end;
end;