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.
How to Get PostData and ResponseData in OnBeforeResourceLoad or OnResourceResponse Event
How to Get PostData and ResponseData in OnBeforeResourceLoad or OnResourceResponse Event
Hi,salvadordf.
Here are some webpage using ajax to update data after pageloaded...
the update url like this : http://xxx/Standard?jsoncallback=jQuery ... 2097411178
and I want to get info from those url....
I can trace it in OnBeforeResourceLoad or OnResourceResponse Event..
but I don't know How to get Info( like PostData and ResponseData ) In those events.
I find there are lack of demo to show how to deal with ICefRequest , ICefResponse...
Can you help me,thanks?
Here are some webpage using ajax to update data after pageloaded...
the update url like this : http://xxx/Standard?jsoncallback=jQuery ... 2097411178
and I want to get info from those url....
I can trace it in OnBeforeResourceLoad or OnResourceResponse Event..
but I don't know How to get Info( like PostData and ResponseData ) In those events.
I find there are lack of demo to show how to deal with ICefRequest , ICefResponse...
Can you help me,thanks?
Re: How to Get PostData and ResponseData in OnBeforeResourceLoad or OnResourceResponse Event
now I have solved how to get postdata by using following code:
tmpEle := tmpList.Items[0] as ICefPostDataElement;
PostData:= AllocMem(tmpEle.GetBytesCount);
tmpEle.GetBytes(tmpEle.GetBytesCount, PostData);
mmolog.Lines.Add(PAnsiChar(PostData));
FreeMemory(PostData);
but still have no idea on how to getResponseData in OnResourceResponse Event
tmpEle := tmpList.Items[0] as ICefPostDataElement;
PostData:= AllocMem(tmpEle.GetBytesCount);
tmpEle.GetBytes(tmpEle.GetBytesCount, PostData);
mmolog.Lines.Add(PAnsiChar(PostData));
FreeMemory(PostData);
but still have no idea on how to getResponseData in OnResourceResponse Event
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: How to Get PostData and ResponseData in OnBeforeResourceLoad or OnResourceResponse Event
Hi,
I'm really busy these days. I'll add a demo about that as soon as I can.
I'm really busy these days. I'll add a demo about that as soon as I can.
Re: How to Get PostData and ResponseData in OnBeforeResourceLoad or OnResourceResponse Event
Ok,Thank you very much.
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: How to Get PostData and ResponseData in OnBeforeResourceLoad or OnResourceResponse Event
Hi,
Download the latest CEF4Delphi version. The new MiniBrowser demo has some simple code that stores the last response status using the TChromium.OnResourceResponse.
These are the code comments about that event :
I'm not sure if the response data you're looking for can be obtained with the ICefResponse.GetHeaderMap procedure inside the TChromium.OnResourceResponse event.
If that's the case, you have the code to read the header map in the TChromium.doOnBeforeResourceLoad procedure in the uCEFChromium.pas file.
Download the latest CEF4Delphi version. The new MiniBrowser demo has some simple code that stores the last response status using the TChromium.OnResourceResponse.
These are the code comments about that event :
Code: Select all
///
// Called on the IO thread when a resource response is received. To allow the
// resource to load normally return false (0). To redirect or retry the
// resource modify |request| (url, headers or post body) and return true (1).
// The |response| object cannot be modified in this callback.
///
If that's the case, you have the code to read the header map in the TChromium.doOnBeforeResourceLoad procedure in the uCEFChromium.pas file.
Re: How to Get PostData and ResponseData in OnBeforeResourceLoad or OnResourceResponse Event
Thanks,but this is not useful for me .... What really I wanted is Get ResponseDate in ResponseContent, not the response header or any others.
for example in OnResourceResponse, the server will return a ajax data like JQquery1983437373838282_123583777(xxxxxx)...and I want to get it ...
as these datas are retrived after the page loadend...so it can be only traced in OnResourceResponse..... I have aready search the response: ICefResponse object ...but can only get header or status....it can not get content body...what is really I wanted.
for example in OnResourceResponse, the server will return a ajax data like JQquery1983437373838282_123583777(xxxxxx)...and I want to get it ...
as these datas are retrived after the page loadend...so it can be only traced in OnResourceResponse..... I have aready search the response: ICefResponse object ...but can only get header or status....it can not get content body...what is really I wanted.
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: How to Get PostData and ResponseData in OnBeforeResourceLoad or OnResourceResponse Event
Hi,
I haven't tested it but maybe this is what you're looking for...
http://www.magpcss.org/ceforum/viewtopi ... =6&t=10794
Take a look at the CustomResourceBrowser demo.
I haven't tested it but maybe this is what you're looking for...
http://www.magpcss.org/ceforum/viewtopi ... =6&t=10794
Take a look at the CustomResourceBrowser demo.
Re: How to Get PostData and ResponseData in OnBeforeResourceLoad or OnResourceResponse Event
ok,i will researh futher, thanks again.
Re: How to Get PostData and ResponseData in OnBeforeResourceLoad or OnResourceResponse Event
Hi crystalxp,
Have you managed to get the responsedata ?
-
- Posts: 18
- Joined: Sun Jan 07, 2018 1:08 am
Re: How to Get PostData and ResponseData in OnBeforeResourceLoad or OnResourceResponse Event
Hi,
Is this problem solved?
Can you share a solution?
Thanks
Is this problem solved?
Can you share a solution?
Thanks