0
public IActionResult MoedaTurismo()
{
try
{
RestClient restClient = new RestClient();
RestRequest restRequest = new RestRequest();
restRequest.AddHeader("cache-control", "no-cache");
restRequest.AddHeader("content-Type", "application/json");
restClient.BaseUrl = new Uri("http://economia.awesomeapi.com.br/USD-BRLT/1");
var response = restClient.Execute(restRequest);
if (response.StatusCode == HttpStatusCode.OK)
{
var json = response.Content;
var Moeda = JsonConvert.DeserializeObject(json);
return (object);
}
return NotFound();
}
catch (Exception ex)
{
return StatusCode((int)HttpStatusCode.InternalServerError);
}
}
I want to convert Json to C#, this correct ?
In theory yes, which error?
– Neto Costa
I need to do the Json to c object conversion#.
– lucas marquebrasillucas18s