CefSharp icon indicating copy to clipboard operation
CefSharp copied to clipboard

Body of request in custom scheme handler

Open kpko opened this issue 11 years ago • 3 comments

Hi,

I created a custom ISchemeHandler and implemented ProcessRequest. In my method, I want to use the request data sent from an AJAX-call (via POST). The request object doesn't have a property like "Body" or "Content". How do I get the POST data? Could you implement another property like "Body"?

kpko avatar Apr 22 '13 09:04 kpko

I'm not sure off the top of my head. I'd have to look at the CEF code and the CefSharp code and see if there's some body property that is available in CEF that we're not binding in CefSharp.

ataranto avatar Apr 22 '13 17:04 ataranto

Hi,

I already found the piece of code which is responsible for the request itself. I'm very newish to c++, so you will have to modify my code a little bit.

Two major caveats on my code:

  1. Post-data is only sent on http/https-requests, so using your own scheme like "app://" won't work. I worked around it by overriding http:// with my custom scheme handler. This is a known issue/feature in webkit: https://code.google.com/p/chromiumembedded/issues/detail?id=404
  2. The PostData-object in Cef is able to hold multiple sets of data (mutipart forms...) This is great in 99% of the use cases I can think of. Maybe we could enhance it to be a little more flexible.

I will add a pull request.

kpko avatar Apr 22 '13 18:04 kpko

thank you!

ataranto avatar Apr 22 '13 18:04 ataranto