Blazor Support for Rest API

Any news on REST Api support in Blazor ?


This can currently be done using Invoke method action.

I uploaded a new example in the Github repository. It shows how to use a REST API (the GitHub issues API). The important code is in the GithubIssues.razor.cs file.

  public class GitHubIssue
    public string Url { get; set; }

    public string Title { get; set; }

    public DateTime Created { get; set; }

  public partial class GithubIssuesComponent
    public HttpClient HttpClient { get; set; }

    public async Task<IEnumerable<GitHubIssue>> GetIssues(string repo)
      var message = new HttpRequestMessage(HttpMethod.Get, $"{repo}/issues?state=open&sort=created&direction=desc");
      message.Headers.Add("Accept", "application/vnd.github.v3+json");
      message.Headers.Add("User-Agent", "HttpClient");

      var response = await HttpClient.SendAsync(message);


      var json = await response.Content.ReadAsStringAsync();

      return JsonSerializer.Deserialize<IEnumerable<GitHubIssue>>(json, new JsonSerializerOptions
        PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
        PropertyNameCaseInsensitive = true,

In Radzen you need to specify the method and invoke it.

Are you still planning on having a similar experience for Rest API's as you have with your Angular implementation?

Yes, REST data sources will be supported in Radzen blazor applications. In fact it is one of the next items we plan to work on!

1 Like