Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用 FormData 方式请求时,值为null的参数在在后台获取的时候是字符串“null” #316

Closed
leyan95 opened this issue May 29, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@leyan95
Copy link

commented May 29, 2019

请求

FormData formData = new FormData.from({
    "code": null,
 });

    Dio dio = new Dio();
    dio.options.baseUrl = url;
    dio.options.responseType = ResponseType.json;
    dio.options.connectTimeout = 5000;
    dio.options.receiveTimeout = 5000;
    Response response = await dio.post(url, data: formData );
    if (response != null && callback != null) {
      callback(response.data);
    }

接收

String code = request.getParameter("code"); // code 值为字符串 “null”

请问我怎么样做才可以获取到正常的null?

@wendux wendux closed this in a8877d1 May 29, 2019

@wendux

This comment has been minimized.

Copy link
Member

commented May 29, 2019

升级到2.1.6重试;变动:如果value为null时,相应的key就会被舍弃。

@leyan95

This comment has been minimized.

Copy link
Author

commented May 29, 2019

好的,感谢😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.