Ich versuche, eine C# Konsole Programm auszuführen:Die Art Argumente für die Methode ‚HttpRequest.asJson()‘ kann nicht
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; }
}
}
Aber das mir folgende Fehler geben:
Error CS0411 The type arguments for method 'HttpRequest.asJson()' cannot be inferred from the usage. Try specifying the type arguments explicitly.
Hat jemand irgendwelche Ideen, was ich falsch machen könnte?
Beachten Sie, wenn Sie 'Dictionary', das ist wahrscheinlich in der Nähe von typenlos, wie Sie in diesem Fall gehen kann. –
Jacob