Instantly share code, notes, and snippets.

Embed
What would you like to do?
public async Task<T> GetAs<T>(string path)
{
var response = await _client.GetStringAsync(path);
return JsonConvert.DeserializeObject<T>(response);
}
public async Task<string> Post(string path, object content)
{
StringContent postContent = new StringContent(JsonConvert.SerializeObject(content));
var response = await _client.PostAsync(path, postContent);
var responseContent = await response.Content.ReadAsStringAsync();
return responseContent;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment