Proper way to respond to POST

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Proper way to respond to POST

Postby emerick » Fri Oct 13, 2017 7:47 pm

A component in my application is sending me a POST request via XmlHttpRequest. The request specifies a "virtual" domain (http://loadhtml/dragdata). I successfully read the POST data in my GetResourceHandler callback, but I'm not exactly sure what to send back in response. I was simply returning NULL, but that resulted in an ERR_NAME_NOT_RESOLVED (which makes sense due to the virtual domain). What's the proper way to respond to this? I feel like I'm missing something. Everything is working correctly for my needs (as far as I can see anyway), I just want this error to go away in DevTools. :D
emerick
Expert
 
Posts: 154
Joined: Sun Feb 21, 2010 7:57 pm
Location: Belmont, MA

Re: Proper way to respond to POST

Postby magreenblatt » Sat Oct 14, 2017 3:41 pm

In GetResourceHandler you should return a CefResourceHandler object. You can use CefStreamResourceHandler for convenience. See https://bitbucket.org/chromiumembedded/ ... me-handler for an example.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Proper way to respond to POST

Postby emerick » Sun Oct 15, 2017 7:38 am

Got it, thank you!
emerick
Expert
 
Posts: 154
Joined: Sun Feb 21, 2010 7:57 pm
Location: Belmont, MA


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 44 guests

cron