Forum Discussion
vvittoria
Mar 22, 2022Copper Contributor
Invoke-WebRequest : { "type": "Client error", "title": "Missing HTTP body" } - Error Api invoke
Dear all,
I need your support about the error indicated in the subject.
The Body field in the cmdlet contain the Json data but it is not possible to execute.
Invoke-WebRequest -Uri 'xxxxx' -Method POST -Headers $headers -ContentType 'application/problem+json' -body $body
- Newbie_JonesBrass ContributorI have a couple of inputs\thoughts.
Had you tried Invoke-RestMethod instead of Invoke-WebRequest?
Is that content type correct? "application/json"
Can you provide a sample of the JSON?