Net Core Api在获取Body的时候出现 Synchronous operations are disallowed. Call WriteAsync or set AllowSynchron

public void ConfigureServices(IServiceCollection services)
{
    // If using Kestrel:
    services.Configure(options =>
    {
        options.AllowSynchronousIO = true;
    });

    // If using IIS:
    services.Configure(options =>
    {
        options.AllowSynchronousIO = true;
    });
}

你可能感兴趣的:(C#,Asp.net,c#)