Added partition key header for get document example.
This commit is contained in:
Родитель
1e245c3d10
Коммит
5fe9de7ad9
|
@ -52,6 +52,11 @@ namespace REST_from.NET
|
|||
static readonly string databaseId = "sandpit";
|
||||
static readonly string collectionId = "data";
|
||||
static readonly string documentId = "test";
|
||||
|
||||
// The partition key is required when getting a document. The value of this is expected
|
||||
// to be a JSON serilized array of strings.
|
||||
static readonly string partitionKey = JsonConvert.SerializeObject(new []{"abc123"});
|
||||
|
||||
static bool idBased = true;
|
||||
|
||||
static readonly string utc_date = DateTime.UtcNow.ToString("r");
|
||||
|
@ -127,6 +132,8 @@ namespace REST_from.NET
|
|||
|
||||
authHeader = GenerateMasterKeyAuthorizationSignature(verb, resourceId, resourceType, masterKey, "master", "1.0");
|
||||
|
||||
client.DefaultRequestHeaders.Add("x-ms-documentdb-partitionkey", partitionKey);
|
||||
|
||||
client.DefaultRequestHeaders.Remove("authorization");
|
||||
client.DefaultRequestHeaders.Add("authorization", authHeader);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче