async Task <KeyValueResponse <TContent> > GetAsync <TContent>(string key, KeyValueOptions options = null) { if (key == null) { throw new ArgumentNullException("key"); } string uri = Uri.EscapeUriString(String.Format("v1/kv/{0}", key)); AppendQueryParameters(ref uri, options); HttpResponseMessage response = await _client.GetAsync(uri); TContent content = await ReadContentAsync <TContent>(response); var reply = new KeyValueResponse <TContent>(response, content); return(reply); }
public async Task <KeyValueResponse <dynamic> > GetDynamicAsync(string key, dynamic options = null) { if (key == null) { throw new ArgumentNullException("key"); } string uri = Uri.EscapeUriString(String.Format("v1/kv/{0}", key)); JObject jo = JObject.FromObject(options); JObjectQueryProvider queryProvider = new JObjectQueryProvider(jo); AppendQueryParameters(ref uri, queryProvider); HttpResponseMessage response = await _client.GetAsync(uri); dynamic content = await ReadContentAsync <dynamic>(response); var reply = new KeyValueResponse <dynamic>(response, content); return(reply); }