public void KeyValuePut() { var kv = new KeyValue(); kv.Key = "test"; kv.Value = "something"; Assert.IsTrue(client.KeyValuePut(kv)); }
public async Task<bool> KeyValuePutAsync(KeyValue kv, int? cas = null, string aquire = null, string release = null, string dc = null) { var uri = GetRequestUri("kv/" + kv.Key); if (!string.IsNullOrEmpty(dc)) uri.AddQuery("dc", dc); if (cas.HasValue) uri.AddQuery("cas", cas.Value); var request = new HttpRequestMessage(HttpMethod.Put, uri); request.Content = new StringContent(kv.Value); var response = await Execute(request); return (response.StatusCode == HttpStatusCode.OK); }
public bool KeyValuePut(KeyValue kv, int? cas = null, string aquire = null, string release = null, string dc = null) { return KeyValuePutAsync(kv, cas, aquire, release, dc).ExecuteSync(); }