Hello I'm following to this guide
static async Task<Product> GetProductAsync(string path)
{
Product product = null;
HttpResponseMessage response = await client.GetAsync(path);
if (response.IsSuccessStatusCode)
{
product = await response.Content.ReadAsAsync<Product>();
}
return product;
}
I use this example on my code and I want to know is there any way to use HttpClient
without async/await
and how can I get only string of response?
Thank you in advance