Skip to content

Commit b5cfdd8

Browse files
yunzhangMSknithinc
authored andcommitted
Fix encoding problem. (#492)
1 parent c1b38dc commit b5cfdd8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Syndication/AzureStack.MarketplaceSyndication.psm1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,10 @@ function InvokeWebRequest {
11231123

11241124
while (-not $completed) {
11251125
try {
1126-
[void]($response = Invoke-WebRequest -Method $Method -Uri $Uri -ContentType "application/json" -Headers $Headers -Body $content -ErrorAction Stop)
1126+
if ($content -ne $null) {
1127+
$content = [System.Text.Encoding]::UTF8.GetBytes($content)
1128+
}
1129+
[void]($response = Invoke-WebRequest -Method $Method -Uri $Uri -ContentType "application/json; charset=utf-8" -Headers $Headers -Body $content -ErrorAction Stop)
11271130
$retryCount = 0
11281131
Ensure-SuccessStatusCode -StatusCode $response.StatusCode
11291132
$completed = $true

0 commit comments

Comments
 (0)