Hey! I had the same issue last week. Turns out, some APIs are picky about trailing slashes in the URL. Try removing or adding one to your URI.
Also, double-check if the API expects the auth header in a different format. Sometimes it's "Bearer" instead of "Basic."
For a cleaner way, you could use `-Credential` with `Get-Credential` instead of manually encoding:
```powershell
$cred = Get-Credential
Invoke-WebRequest -Uri "https://example.com" -Credential $cred
```
Might save you some headaches!
Also, double-check if the API expects the auth header in a different format. Sometimes it's "Bearer" instead of "Basic."
For a cleaner way, you could use `-Credential` with `Get-Credential` instead of manually encoding:
```powershell
$cred = Get-Credential
Invoke-WebRequest -Uri "https://example.com" -Credential $cred
```
Might save you some headaches!
