【发布时间】:2017-12-09 04:23:18
【问题描述】:
$url = "https://teamcity.myserver.io/guestAuth/app/rest/buildTypes/id:SandboxPlayGround_WindowsForms1_Build/parameters/Version"
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Content-Type", 'text/plain')
$headers.Add("Origin", 'https://teamcity.myserver.io')
Invoke-RestMethod -Method Put -Uri $url -Headers $headers -Body "2.3.1.0"
给我错误:
[19:54:59][Step 2/6] Invoke-RestMethod : HTTP Status 405 - Request method 'PUT' not supported
[19:54:59][Step 2/6]
[19:54:59][Step 2/6]
[19:54:59][Step 2/6]
[19:54:59][Step 2/6] type Status report
[19:54:59][Step 2/6] message Request method 'PUT' not supported
[19:54:59][Step 2/6] description The specified HTTP method is not allowed for the requested resource.
但是我可以使用来自 PostMan 的相同 URL 和标头来更新参数值。 我哪里错了?
【问题讨论】:
标签: powershell continuous-integration teamcity continuous-deployment fluenttc