title: Pass id parameter in fetch query (ReactJS)
body: <p>I am new in javscript development, and I have some trouble with passing id parameter in query URL. 
  I am passing ID value in body now, which is not right, I guess in REST approach.</p>
  
  <p>How can I pass <code>Id: event.target.DepartmentId.value,</code> into URL like <code>https://localhost:5001/api/departments/{id}</code> ?</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>handleSubmit(event){
      event.preventDefault();
      fetch("https://localhost:5001/api/departments/", {
          method: "PUT",
          headers:{
              "Accept":"application/json",
              "Content-Type":"application/json",
              "Origin": "*"
          },
          body: JSON.stringify({
              Id: event.target.DepartmentId.value,
              Name: event.target.DepartmentName.value
          })
      })
      .then(res=&gt;res.json())
      .then((result)=&gt;
      {
          this.setState({snackbaropen: true, snackbarmsg: "Edited successfully!"})
          
      },
      (error) =&gt;{
          this.setState({snackbaropen: true, snackbarmsg: "failed"})
      }
      )
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Thanks for any help!</p>