dcef3
dcef3 copied to clipboard
ICefRequest.PostData always is nil.
Hi, I registered a custom scheme which refer to the TFileScheme. and I post a request which has headers, body, now I can get the headers of request, but I cannot get body of request because of ICefRequest.PostData always return nil. here is my code:
mydpr.dpr;
...
begin
...
CefRegisterSchemeHandlerFactory('native', '', TWebNativeScheme);
...
end.
unit WebNativeScheme;
...
TWebNativeScheme = class(TCefResourceHandlerOwn)
private
FFrame: ICefFrame;
FBrowser: ICefBrowser;
FResponse: IWebResponse;
FResponseStream: TMemoryStream;
protected
// in this method, request.postData always is nil.
function ProcessRequest(const request: ICefRequest;
const callback: ICefCallback): Boolean; override;
...
public
constructor Create(const browser: ICefBrowser; const frame: ICefFrame;
const schemeName: ustring; const request: ICefRequest); override;
destructor Destroy; override;
end;
....
myhtml.html:
...
Ajax.post({
headers: {
key: 'value'
},
url: 'native://ResouceHandler.dll/Unit3/TResourceHandler',
data: { key1: 'value1' },
onSuccess: function(http){
alert(http.responseText);
},
onError: function(http){
alert("fail");
}
});
...
Please tell me this is my code wrong, or CEF itself. Thanks.
Hi, I have the same issue. Did you solved it?
No :(