Hello,
how do I get the body of a request?
Inside this boby is a JSON that you need to search when loading a site.
procedure TForm1.Chromium1ResourceResponse(Sender: TObject;
const browser: ICefBrowser; const frame: ICefFrame;
const request: ICefRequest; const response: ICefResponse;
out Result: Boolean);
var
PostData: ICefPostData;
i: integer;
begin
PostData := request.PostData;
if (PostData <> nil) then
begin
for i := 0 to PostData.GetCount -1 do
begin
end;
end;
end;
I don't know how to convert ICefPostData content to a string.
Thanks
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.
Get body Request.
- salvadordf
- Posts: 4565
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Get body Request.
If your application makes the request then you can use a TCEFUrlRequestClientComponent component. The URLRequest demo shows how to create the request and get all the data.
If you need to intercept the results of a request then you can use the code in the ResponseFilterBrowser demo.
If you need to intercept the results of a request then you can use the code in the ResponseFilterBrowser demo.
Re: Get body Request.
I couldn't understand the ResponserFilterBrowser example.
What I need is, the page I'm accessing when I click a print button, he makes a request, and in this request he passes a JSON on Post, so I need to get this POST to get this JSON ...
What I need is, the page I'm accessing when I click a print button, he makes a request, and in this request he passes a JSON on Post, so I need to get this POST to get this JSON ...
- salvadordf
- Posts: 4565
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Get body Request.
Sorry, I misunderstood.
Then you need to use the PostInspectorBrowser demo. That demo inspects the POST data in all requests using the TChromium.OnBeforeResourceLoad event.
Then you need to use the PostInspectorBrowser demo. That demo inspects the POST data in all requests using the TChromium.OnBeforeResourceLoad event.