title: Why Javascript fetch method putting unnecessary / in the URL
body: <p>I am sending a GET request with parameters on the URL. The problem is that, While sending a request, The URL is modified and includes an extra &quot;/&quot; which is not by me. I am also using Django.</p>
  <p>Code:</p>
  <pre><code>     let url = `ajax_vehical_types`;
            groups.map(async (x, i) =&gt; {
              if (i === 0) url += `?group[${i}]=${x}`;
              else url += `&amp;group[${i}]=${x}`;
            });
  
  
  
  
      vehical_type = await fetch(`${window.location.origin}/${url}`)
            .then((res) =&gt; res.json())
            .then((data) =&gt; data);
  </code></pre>
  <p>Here is the result
  <a href="https://i.stack.imgur.com/Rz1pa.png" rel="nofollow noreferrer">Image showing the console with fetch request</a></p>