ataranto / CefSharp

.Net binding for the Chromium Embedded Framework
Other
62 stars 34 forks source link

Body of request in custom scheme handler #48

Open kpko opened 11 years ago

kpko commented 11 years ago

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"?

ataranto commented 11 years ago

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.

kpko commented 11 years ago

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.

ataranto commented 11 years ago

thank you!