-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Headers of WebResponseObject object are returned as Array of String instead of String #13378
Copy link
Copy link
Closed
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-AnsweredThe question is answered.The question is answered.
Description
Problem description
The headers of Microsoft.PowerShell.Commands.BasicHtmlWebResponseObject object returned by Invoke-WebRequest, are returned as Arrays of String instead of String.
This problem seems specific to the Headers dictionary of the WebResponse object.
Steps to reproduce
$r = Invoke-WebRequest -Uri "https://www.microsoft.com/en-us/"
$r.Headers['Content-Type'].GetType()Expected behavior
On Powershell 5.1:
IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True True String System.Object
Actual behavior
IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True True String[] System.Array
Environment data
Name Value
---- -----
PSVersion 7.0.3
PSEdition Core
GitCommitId 7.0.3
OS Linux 3.10.0-1127.10.1.el7.x86_64 #1 SMP Tue May 26 15:05:43 EDT 2020
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-AnsweredThe question is answered.The question is answered.