DEV Community

Discussion on: The broken promise of static typing

Collapse
 
bbttss profile image
bbttss

Hey, regarding calling REST API from C# take a look at DalSoft.RestClient

dynamic client = new RestClient("http://jsonplaceholder.typicode.com");

await client.Users.Get();
Enter fullscreen mode Exit fullscreen mode

or try using HttpClient

var httpClient = new HttpClient();
var content = await httpClient.GetStringAsync(uri);
return await Task.Run(() => JsonObject.Parse(content));
Enter fullscreen mode Exit fullscreen mode

Hope it helps!