0

When I send input to PowerShell put request it throws an internal error.

This is the response I got:

   "message": "Internal Error"
   "status": "failed"

The code snippet is as follows:

$input_data=@"
{
  "share": {
    "users": [
      {
        "id": 3
      }
    ]
  }
}
"@
$postParams = @{ INPUT_DATA=$input_data; format="json" }
$response = Invoke-WebRequest -Uri $url -Method PUT -Body $postParams
Moerwald
  • 10,448
  • 9
  • 43
  • 83
  • Try the following, `$postParams = @{ INPUT_DATA=$input_data }` and specify the content type `$response = Invoke-WebRequest -Uri $url -Method PUT -Body $postParams -ContentType "application/json"` – Thangadurai Jun 28 '19 at 04:13
  • No still it is not working. Actually for the code I posted output is fine in postman but in chrome it is not working the response text(in chrome) is {share={}} – Abirami Murukesan Jun 28 '19 at 04:31
  • Check the HTTP Request payload with fiddler for both postman and chrome. – Thangadurai Jun 28 '19 at 04:59

0 Answers0