小编Dey*_*Paz的帖子

不可为空的属性必须包含非空值

有没有办法处理 Visual Studio for mac 中的“非空属性必须包含非空值”警报。好吧,我找不到通过从 csproj 项目文件或配置中删除该行来禁用它的方法。这些警告位于我的数据库模型和视图中,我们的想法是以最佳方式进行。应该说我用的是.Net 6.0

预先感谢您花时间阅读这个问题。

.net c# visual-studio asp.net-web-api

5
推荐指数
1
解决办法
1万
查看次数

在 flutter 中收到完整标头之前连接已关闭 http post

我在尝试使用我的 API 时遇到问题,在跟进这个问题后,我陷入了困境,我尝试了不同版本的不同模拟器,但问题仍然存在。

错误:

DioError [DioErrorType.other]: HttpException: Connection closed before full header was received, uri = http://10.0.2.2:7108/Users/authenticate
Run Code Online (Sandbox Code Playgroud)

扑医生

在此输入图像描述

HTTP 邮递

class AuthenticateRemoteApi extends AuthenticateGateway {
  final AuthenticateMapper _authenticateMapper = AuthenticateMapper();

  @override
  Future<SesionUser> login(Authenticate user) async {
    var dio = Dio();
    dio.options.headers['content-Type'] = 'application/json';
    String url = 'http://10.0.2.2:7108/Users/authenticate';

    try {
      Response response = await dio.post(url, data: authenticateModelToJson(user));
      return _authenticateMapper.fromMap(jsonDecode(response.data));
    } catch (e) {
      throw Exception(e);
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

android-studio flutter dio

2
推荐指数
1
解决办法
1万
查看次数