public async Task <IActionResult> Index([FromForm] string Number) { ViewBag.Searched = false; try { var configs = _configRepository.List(); string resquestId = Guid.NewGuid().ToString(); object data = new { chaveIntegracao = configs.FirstOrDefault(x => x.Name == "IntegrationKey")?.Value ?? "4B335B6F-9C4D-47F7-B798-C46FFBC4881A", codigoLoja = configs.FirstOrDefault(x => x.Name == "MallCode")?.Value ?? "1", numeroCartao = Number, nsuCliente = resquestId, codigoSeguranca = "123" }; HttpResponseMessage response = await _client.PostAsync("/LinxServiceApi/FidelidadeService/ConsultaFidelizacao", data.AsJson()); string result = await response.Content.ReadAsStringAsync(); _logRepository.Save(new Model.Log { Datetime = DateTime.Now, RequestId = resquestId, Message = result }); JToken jsonresult = Newtonsoft.Json.JsonConvert.DeserializeObject <JToken>(result); ViewBag.Result = jsonresult; ViewBag.Searched = true; } catch (Exception ex) { Console.WriteLine(ex.ToString()); } return(View()); }