@page "/meter"
@inject HttpClient Http
<h3>Meter</h3>
@if (stu == null)
{
<p><em>Loading...</em></p>
}
else
{
<h1>@stu.name</h1>
}
@code {

private Student stu;

protected override async Task OnInitializedAsync()
{
Http = new HttpClient();
stu = await Http.GetFromJsonAsync<Student>("http://localhost:5001/test/ceshi3");
Console.WriteLine("打印:" + stu.name);
}

public class Student
{
public int age { get; set; }
public string name { get; set; }
}
}