微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

.NET CORE_Blazor找不到Http.SendAsJsonAsync

如何解决.NET CORE_Blazor找不到Http.SendAsJsonAsync

请尝试在.Net Core Blazor项目中调用我的Web API请求。我似乎找不到 Http.SendAsJsonAsync ,我是 Http.SendAsAsync ,请问我该怎么办?这是否意味着在3.1中我们不能使用SendAsJsonAsync,或者我错过了特定的引用?

请在下面找到图像截图和代码。谢谢

enter image description here

示例代码在这里

@page "/counter"
@using BlazeCRUD.Models;
@using BlazeCRUD.Services;
@using System.Net.Http;
@inject HttpClient Http
@inherits OwningComponentBase<BlazeServices>



<h3><b>New Loan Application</b></h3>

<p></p>


<div class="row">
    <div class="col-md-4">
        <form>
            <div class="form-group">
                <label for="Name" class="control-label">Name</label>
                <input for="Name" class="form-control" bind="" />
            </div>

            <div class="form-group">
                <label asp-for="Department" class="control-label">Department</label>
                <input asp-for="Department" class="form-control" bind="" />
            </div>

            <div class="form-group">
                <button type="submit" class="btn btn-default" onclick="">Save</button>
                <button class="btn" onclick="">Cancel</button>
            </div>
        </form>
    </div>
</div>


@code  {

    Performanceappuser pc = new Performanceappuser();

    protected async Task AddLoanApplication()
    {

        await Http.
    }

    List<Performanceappuser> pau;

    protected override void OnInitialized()
    {
        pau = Service.appUser();
    }

}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。