So I've a problem with my code. I mean, when I am building it, console shows me an error like: "Unhandled exception. Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: {. Path 'ranked', line 1, position 11." What should I do? I will add my code down below my issue
using System.Net.Http;
using System.Threading.Tasks;
namespace WhatIsMyMMRv2
{
class Program
{
static async Task Main(string[] args)
{
var httpClient = HttpClientFactory.Create();
var URL = "https://eune.whatismymmr.com/api/v1/summoner?name=Kams0n";
HttpResponseMessage httpResponseMessage = await httpClient.GetAsync(URL);
if (httpResponseMessage.StatusCode == System.Net.HttpStatusCode.OK)
{
var content = httpResponseMessage.Content;
var data = await content.ReadAsAsync<Data>();
Console.WriteLine(data);
} else
{
Console.WriteLine($"Error " + httpResponseMessage.StatusCode);
}
}
}
}
public class Data
{
public string Ranked
{
get;
set;
}
public string Normal
{
get;
set;
}
public string Aram
{
get;
set;
}
public override string ToString()
{
return $"{Ranked}, {Normal}, {Aram}";
}
} ``