I am trying to run a C# console program:
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Task<HttpResponse<MyClass>> response = Unirest.get("https://wordsapiv1.p.mashape.com/words/cat/rhymes")
.header("X-Mashape-Key", "xxx")
.header("Accept", "application/json")
.asJson();
}
}
internal class MyClass
{
public string word { get; set; }
}
}
But this is giving me the following error:
Error CS0411 The type arguments for method 'HttpRequest.asJson()' cannot be inferred from the usage. Try specifying the type arguments explicitly.
Does anyone have any ideas as to what I may be doing wrong?