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.

View Request.PostData to str

dilfich
Posts: 330
Joined: Thu Nov 30, 2017 1:17 am

Re: View Request.PostData to str

Post by dilfich »

FResponse.Add(TempHeaderMap.Key + '=' + TempHeaderMap.Value);

But there's only headers, not the content..
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: View Request.PostData to str

Post by salvadordf »

Try the ResponseFilterBrowser demo.
Modify TResponseFilterBrowserFrm.IsMyResource to identify the URL of the request that you want to inspect.
Also modify TResponseFilterBrowserFrm.Filter_OnFilter to use the CopyScript function and it will copy the contents in FStream.
dilfich
Posts: 330
Joined: Thu Nov 30, 2017 1:17 am

Re: View Request.PostData to str

Post by dilfich »

Does not work with OSR browser (((
GetResourceResponseFilter...........
var
TempHeader : string;
TempLen : integer;
begin
if (response <> nil) and (request.Method = 'POST') then
begin
Result := FCFilter;
TempHeader := trim(response.GetHeader('Content-Length'));

if TryStrToInt(TempHeader, TempLen) and (TempLen > 0) then
FRCscSize[NumAK] := TempLen
else
FRCscSize[NumAK] := -1;

end
else
Result := nil;
end;
If you comment out the Result := FCFilter; then there is no error but not working of course.
You do not have the required permissions to view the files attached to this post.
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: View Request.PostData to str

Post by salvadordf »

FCFilter needs to be a ICefResponseFilter interface or a class that implements the ICefResponseFilter interface in order to assign it to "Result".
dilfich
Posts: 330
Joined: Thu Nov 30, 2017 1:17 am

Re: View Request.PostData to str

Post by dilfich »

Code: Select all

FCFilter: ICefResponseFilter;
....
procedure TForm1.FormCreate(Sender: TObject);
......
FCFilter:= TCustomResponseFilter.Create;
I do as shown in the demo, with the usual not OSR everything works for me.
OSR create itself, maybe this is the problem?
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: View Request.PostData to str

Post by salvadordf »

TChromium has the same "OnGetResourceResponseFilter" event with the same parameters for OSR or normal mode.
Right now I'm very busy but I'll take a look as soon as I can.
dilfich
Posts: 330
Joined: Thu Nov 30, 2017 1:17 am

Re: View Request.PostData to str

Post by dilfich »

I tried to do in OSRExternalPumpBrowser, everything works. But in my application for some reason not. I myself create several browsers ChromOSR[Thrd]:= TChromium.Create (nil); but even if 1 create the would still not works. :?
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: View Request.PostData to str

Post by salvadordf »

Test your app creating only one TChromium.

I didn't create the ResponseFilterBrowser demo thinking of multiple browsers sharing the same filter and "OnFilter" event.

If your app works with one browser then create as many filters as TChromium components. I would also use different "OnFilter" events.
dilfich
Posts: 330
Joined: Thu Nov 30, 2017 1:17 am

Re: View Request.PostData to str

Post by dilfich »

Code: Select all

  
  ChromOSR[Thrd]:= TChromium.Create(nil);
  ................................
  FRCscSize[Thrd]       := -1;
  FFilterOSR[Thrd]:= TCustomResponseFilter.Create;
  TCustomResponseFilter(FFilterOSR[Thrd]).OnFilter := Form1.Filter_OnFilter;
 
Or wrong..
It seems to work with one browser, as in the procedure Filter_OnFilter you identify which instance number?
dilfich
Posts: 330
Joined: Thu Nov 30, 2017 1:17 am

Re: View Request.PostData to str

Post by dilfich »

In General, made a class with"FTagID: Integer;".. it seems everything is working as it should) :|
Post Reply