Skip to content

Tag: 100-continue Header

Invoke-WebRequest and Invoke-RestMethod get (401) Unauthorized without any reason

I use PowerShell to access a lot of API’s! Since a while some calls that are correct get the error: “The remote server returned an error: (401) Unauthorized.”.

In my case, this was only the case when I used Windows PowerShell (e.g., PowerShell 5.x)! PowerShell Core (7.x) worked fine.