Here-String

Why does Invoke-RestMethod reject my JSON request body?

I'm converting a curl request to PowerShell's Invoke-RestMethod for an API endpoint that expects a JSON array of objects. The curl request sends an array like [{"key1":"value1","key2":"value2"},{"key1":"value3","key2":"value4"}]. I…