How to view the HTTP request sent by powershell when using Invoke-RestMethod?

Viewed 2101

I'm trying to debug a multi-part/formdata HTTP request being sent to an api in Powershell, I want to see what powershell actually sends in the form of a HTTP request to the server.

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.

This is my request:

$resp = Invoke-RestMethod -Uri $url -Headers $headers -Method "Post" - 
ContentType "multipart/form-data; boundary=$boundary" -Body $bodyLines

Any help is appreciated.

0 Answers
Related