dcef3 icon indicating copy to clipboard operation
dcef3 copied to clipboard

ICefRequest.PostData always is nil.

Open gxlmyacc opened this issue 8 years ago • 2 comments

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.

gxlmyacc avatar Apr 25 '16 09:04 gxlmyacc

Hi, I have the same issue. Did you solved it?

simumb avatar Jul 12 '16 08:07 simumb

No :(

gxlmyacc avatar Jul 14 '16 11:07 gxlmyacc