Skip to content

Commit 4587e5a

Browse files
author
James Brundage
committed
Updating Rest Transpiler (fixing #141, #140)
1 parent 7da2ee7 commit 4587e5a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Transpilers/Rest.psx.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ process {
430430
if ($method) {
431431
$invokeSplat.Method = $method
432432
}
433-
if ($ContentType) {
433+
if ($ContentType -and $invokerCommandInfo.Parameters.ContentType) {
434434
$invokeSplat.ContentType = $ContentType
435435
}
436436
}
@@ -520,7 +520,7 @@ process {
520520
@(foreach ($bodyPart in $completeBody.GetEnumerator()) {
521521
"$($bodyPart.Key.ToString().ToLower())=$([Web.HttpUtility]::UrlEncode($bodyPart.Value))"
522522
}) -join '&'
523-
} elseif ($ContentType -match 'json') {
523+
} elseif ($ContentType -match 'json' -or -not $ContentType) {
524524
ConvertTo-Json $completeBody
525525
}
526526

0 commit comments

Comments
 (0)