public async Task SetValues(params KeyValuePair <string, string>[] values) { using (var jsonvalues = HttpClientHelper.CreateJsonContent(values)) { HttpResponseMessage response = await Client.PostAsync(String.Empty, jsonvalues); response.EnsureSuccessful(); } }
public void RevertFile(string path) { using (var jsonContent = HttpClientHelper.CreateJsonContent(new KeyValuePair <string, string>("path", path))) { Client.PostAsync("remove", jsonContent) .Result .EnsureSuccessful(); } }
public async Task SetValue(string key, string value) { using (var values = HttpClientHelper.CreateJsonContent(new KeyValuePair <string, string>(key, value))) { HttpResponseMessage response = await Client.PostAsync(String.Empty, values); response.EnsureSuccessful(); } }
public void Update(string id) { using (var jsonContent = HttpClientHelper.CreateJsonContent(new KeyValuePair <string, string>("id", id))) { Client.PostAsync("update", jsonContent) .Result .EnsureSuccessful(); } }
public ChangeSet Commit(string message, string authorName) { string json = _client.PostAsync("commit", HttpClientHelper.CreateJsonContent(new KeyValuePair <string, string>("name", authorName), new KeyValuePair <string, string>("message", message))) .Result .EnsureSuccessStatusCode() .Content.ReadAsStringAsync() .Result; return(JsonConvert.DeserializeObject <ChangeSet>(json)); }
public void RevertFile(string path) { _client.PostAsync("remove", HttpClientHelper.CreateJsonContent(new KeyValuePair <string, string>("path", path))) .Result .EnsureSuccessStatusCode(); }
public void Update(string id) { _client.PostAsync("update", HttpClientHelper.CreateJsonContent(new KeyValuePair <string, string>("id", id))) .Result .EnsureSuccessStatusCode(); }
private void DeleteValue(string section, string key) { _client.PostAsync(section + "/remove", HttpClientHelper.CreateJsonContent(new KeyValuePair <string, string>("key", key))) .Result .EnsureSuccessStatusCode(); }
private void SetValue(string section, string key, string value) { _client.PostAsync(section + "/set", HttpClientHelper.CreateJsonContent(new KeyValuePair <string, string>("key", key), new KeyValuePair <string, string>("value", value))) .Result .EnsureSuccessStatusCode(); }
public Task SetValue(string key, string value) { var values = HttpClientHelper.CreateJsonContent(new KeyValuePair <string, string>("key", key), new KeyValuePair <string, string>("value", value)); return(_client.PostAsync(String.Empty, values).Then(response => response.EnsureSuccessStatusCode())); }
public void WriteAllText(string path, string content) { _client.PostAsync("save", HttpClientHelper.CreateJsonContent(new KeyValuePair <string, string>("path", path), new KeyValuePair <string, string>("content", content))) .Result .EnsureSuccessStatusCode(); }
public void WriteAllText(string path, string content) { _client.PutAsync(path, HttpClientHelper.CreateJsonContent(new KeyValuePair <string, string>("content", content))) .Result .EnsureSuccessful(); }
public Task SetValues(params KeyValuePair <string, string>[] values) { var jsonvalues = HttpClientHelper.CreateJsonContent(values); return(_client.PostAsync(String.Empty, jsonvalues).Then(response => response.EnsureSuccessful())); }
public void AddFile(string path) { _client.PostAsync("add", HttpClientHelper.CreateJsonContent(new KeyValuePair <string, string>("path", path))) .Result .EnsureSuccessful(); }