-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
When using a POST, ContentType is automatically set to application/x-www-form-urlencoded
invoke-restmethod https://webhook.site/6a5097af-3644-4462-9d92-d910088d2f4d -Method POST -Body @{ Test = "test" }
When using other methods, it is not. It is blank.
invoke-restmethod https://webhook.site/6a5097af-3644-4462-9d92-d910088d2f4d -Method PUT -Body @{ Test = "test" }
Expected behavior
I would expect that the content type would default to form encoded for all request methods (or at least for PUT). Actual behavior
It is only set to form encoded for POST.Error details
No errors.Environment data
Name Value
---- -----
PSVersion 7.2.0-rc.1
PSEdition Core
GitCommitId 7.2.0-rc.1
OS Microsoft Windows 10.0.22000
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
### Visuals
_No response_
Metadata
Metadata
Assignees
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module
