title: Electron webview loadURL POST
body: <p>I couldn't find any similar question on SO.</p>
  
  <p>Could someone show me an example on how to use loadURL with POST?  I'm currently doing the following</p>
  
  <pre><code>const url = firebaseCloudFunctionURL+"/endpointAPI";
  const webview = document.createElement('webview');
  webview.setAttribute("src", "https://www.nytimes.com/"); // forces dom-ready event to be called
  webview.addEventListener('dom-ready', () =&gt; {
      const postDict = {
          query: "test_string"
      };            
      webview.loadURL(url, {postData: postDict});
  });
  </code></pre>
  
  <p>But the web server shows that the request body is empty.<br>
  (Using Firebase cloud functions)</p>
  
  <pre><code>exports.endpointAPI = functions.https.onRequest((req, res) =&gt; {
      const test = req.body.shop;
      console.log("req.body "+ JSON.stringify(req.body));
  });
  </code></pre>
  
  <p>Which yields "req.body {}" in logs.</p>
  
  <p>In the <a href="https://electronjs.org/docs/api/webview-tag#webviewloadurlurl-options" rel="nofollow noreferrer">electron documentation</a> postData is written with UploadRawData[].  But there is no example code.  Has anyone ever gotten it to work?</p>