title: Use cURL XPOST in JavaScript
body: <p>I have been provided with the following cURL function:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>curl -XPOST -u 'USERNAME:PASSWORD' http://distribution.virk.dk/cvr-permanent/virksomhed/_search -d '
  {
      "query":{"term":{"Vrvirksomhed.cvrNummer":"30714024"}}
  }' | python -mjson.tool</code></pre>
  </div>
  </div>
  </p>
  <p>How can I convert this to be used on my WordPress site? (I need to use this in my JavaScript)</p>
  <p>The goal is to get information on a company in JSON, which I'll convert to an object.</p>
  <p>There is a site that does this (in a slightly different way, <a href="https://cvrapi.dk/documentation" rel="nofollow noreferrer">https://cvrapi.dk/documentation</a>), but I need to do it natively on my own website with my own Username and Password.</p>