How do I pass the login
object as a parameter to the GetAsync
method?
I'm trying to do it this way, but I did not understand the error message:
private async Task<JsonResult> obterLogin(Login login)
{
try
{
HttpClient httpCliente = new HttpClient();
httpCliente.BaseAddress = new Uri("http://localhost:55838/");
httpCliente.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
HttpResponseMessage response = await httpCliente.GetAsync("MedClinApi/Login/Obter/ { login }", login);
var json = await response.Content.ReadAsStringAsync();
return JsonConvert.DeserializeObject<JsonResult>(json, new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver() });
}
catch
{
throw;
}
}