title: How to view the HTTP request sent by powershell when using Invoke-RestMethod?
body: <p>I'm trying to debug a multi-part/formdata HTTP request being sent to an api in Powershell, <b>I want to see what powershell actually sends in the form of a HTTP request to the server.</b></p>
  
  <p>So far im just setting a variable to my request but am only able to retrieve the response which im not interested in as my request returns an error.</p>
  
  <p>This is my request:</p>
  
  <pre><code>$resp = Invoke-RestMethod -Uri $url -Headers $headers -Method "Post" - 
  ContentType "multipart/form-data; boundary=$boundary" -Body $bodyLines
  </code></pre>
  
  <p>Any help is appreciated.</p>