Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

ICefRequest.PostData always is nil. #21

Open
gxlmyacc opened this issue Apr 25, 2016 · 2 comments
Open

ICefRequest.PostData always is nil. #21

gxlmyacc opened this issue Apr 25, 2016 · 2 comments

Comments

@gxlmyacc
Copy link

gxlmyacc commented Apr 25, 2016

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.

@simumb
Copy link

simumb commented Jul 12, 2016

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

@gxlmyacc
Copy link
Author

No :(

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants