Forum Discussion

JasonAsAService's avatar
JasonAsAService
Copper Contributor
May 26, 2021

Invoke-RestMethod Accept Header not working properly in Azure

I am consuming an API that returns different input depending on the Accept header.

'Accept' = 'application/json' ( or empty / default) returns JSON
'Accept' = 'application/hujson' returns Human Readable JSON which I need in this case

Using PowerShell on my desktop, this works as expected.

The exact same code in Azure CLI or PS-Core function app always returns JSON no matter what the Accept header specifies.

Any idea how to go about resolving this?

 

 

No RepliesBe the first to reply

Resources