CefPostData::ElementVector for POST-request == 0

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.

CefPostData::ElementVector for POST-request == 0

Postby Staxcelrom » Mon Apr 04, 2022 8:09 am

Hello,

I use GetResourceResponseFilter to write the body of the POST-request, and everything works fine, but for some reason sometimes for some POST-request- the body is missing. Here is the simplified code I use:


Code: Select all
   virtual CefRefPtr<CefResponseFilter> GetResourceResponseFilter(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, CefRefPtr<CefRequest> request, CefRefPtr<CefResponse> response)
   {
         std::string my_method= (*request).GetMethod().ToString();

               if(my_method == POST)
               {

      CefRefPtr<CefPostData> CefPostData_ptr = (*request).GetPostData(); 

      CefPostData::ElementVector elements_post_vec;                       

      (*CefPostData_ptr).GetElements(elements_post_vec);           //Not always, but sometimes for some reason the elements_post_vec is zero.

               }
        }


This is despite the fact that when I request GetHeaderMap from a request - there is clearly a long POST of the request: content-length:43

Is this normal?
Staxcelrom
Expert
 
Posts: 206
Joined: Wed Jan 26, 2022 8:20 am

Return to Support Forum

Who is online

Users browsing this forum: No registered users and 36 guests