We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7da2ee7 commit 4587e5aCopy full SHA for 4587e5a
Transpilers/Rest.psx.ps1
@@ -430,7 +430,7 @@ process {
430
if ($method) {
431
$invokeSplat.Method = $method
432
}
433
- if ($ContentType) {
+ if ($ContentType -and $invokerCommandInfo.Parameters.ContentType) {
434
$invokeSplat.ContentType = $ContentType
435
436
@@ -520,7 +520,7 @@ process {
520
@(foreach ($bodyPart in $completeBody.GetEnumerator()) {
521
"$($bodyPart.Key.ToString().ToLower())=$([Web.HttpUtility]::UrlEncode($bodyPart.Value))"
522
}) -join '&'
523
- } elseif ($ContentType -match 'json') {
+ } elseif ($ContentType -match 'json' -or -not $ContentType) {
524
ConvertTo-Json $completeBody
525
526
0 commit comments