I am trying to use Cosmos DB REST API using Invoke-RestMethod method .My headers are as below
'Authorization' = $authToken
'x-ms-date' = $UTCTimeNow
'x-ms-version' = '2017-02-22'
'x-ms-documentdb-partitionkey' = @($partitonKey)
}
response received is Partition key System.String[] is invalid. It seems Powershell is not sending x-ms-documentdb-partitionkey as an array.Is there a way to pass array in headers in powershell web request
,:'x-ms-documentdb-partitionkey' = ,$partitonKey, see also: Why is a leading comma required when creating an array?'x-ms-documentdb-partitionkey' = '["<partitonKey vaule>"]'-ContentType 'application/json'on your POST.