I trying to converting .net Browser request method on my source code to cefsharp Chromium but I have a big problem :( Cefsharp LoadUrlWithPostData is not working like this :( I have so many post requests in my code what is simple method for cefsharp I need change PostRequest codes for cefsharp

This is the original working .netBrowser PostRequest method

           private void PostRequest(Uri p_Uri, NameValueCollection p_PostData)
        {
            try
            {
                m_HttpHandler.Headers.Add("X-Requested-With", "XMLHttpRequest");
                m_HttpHandler.UploadValuesAsync(p_Uri, p_PostData);
                m_HttpHandler.Headers.Remove("X-Requested-With");
            }
            catch (Exception ex)
            {
                Logger.WriteExceptionToLog(ex.Message);
            }
        }

.NetBrowser Post Request Example;


  private void UpdateCollectDataRequest()
        {

            try
            {
                 var l_Url = "https://" + Settings.MainUrl + "/collect/data?data_id=" + Data3 +
                            "&action=get&h=" + H;

                PostRequest(new Uri(l_Url), new NameValueCollection() { { "json", "{\"types\":[{\"type\":\"map\",\"param\":{\"x\":7,\"y\":5}},{\"type\":\"bar\"},{\"type\":\"backbone\"}],\"data_id\":" + Data3 + ",\"nl_init\":false}" } });


            }
            catch (Exception ex)
            {
                Logger.WriteExceptionToLog(ex.Message);
            }
        }

Can anyone help me ? How can I do this with CefSharp

0 Answers