Lazy Diary @ Hatena Blog

PowerShell / Java / miscellaneous things about software development, Tips & Gochas. CC BY-SA 4.0/Apache License 2.0

What curl can do and Invoke-WebRequest can't do

  • curl can show the raw request header and body with --trace option*1. There is no way to get the content of the request with Invoke-WebRequest.
  • curl can show the body of 5xx response. Invoke-WebRequest returns null when a server responds with status 4xx or 5xx, so you cannot view the body of the response.
  • curl shows the content of the 302 Found response when a server redirects the request. Invoke-WebRequest only shows the content of the 200 response in the same situation.