$body = @{ provider_id = 2 provider_code = "TDC2002" provider_type = "internal" } | ConvertTo-Json -Depth 5 try { $response = Invoke-WebRequest -Uri "http://dcme.com.au/api/provider_full_clone_debug.php" ` -Method POST ` -Body $body ` -ContentType "application/json" ` -TimeoutSec 60 ` -UseBasicParsing Write-Host "STATUS:" $response.StatusCode Write-Host "RESPONSE:" $response.Content } catch { Write-Host "ERROR:" $_.Exception.Message if ($_.Exception.Response) { $reader = New-Object System.IO.StreamReader($_.Exception.Response.GetResponseStream()) $reader.BaseStream.Position = 0 $reader.DiscardBufferedData() $reader.ReadToEnd() } }