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

Content size exceeds specified contentLength #72

Closed
BytesZero opened this issue Sep 20, 2018 · 2 comments
Closed

Content size exceeds specified contentLength #72

BytesZero opened this issue Sep 20, 2018 · 2 comments

Comments

@BytesZero
Copy link

Steps to Reproduce

  • 请求方式
Map<String, dynamic> data
dio.post(path, data: data);
  • 请求失败
requestPost host:http://api-shuangshi.test.tengyue360.com/ path:/backend/student/stuApp/evaluate data:{content: 测试测试测试, courseId: 110, score: 3, anonymous: 1, evaluateObject: 2, timestamp: 1537426578634}

如果我把content换成英文,则请求成功。

  • 请求成功
requestPost host:http://api-shuangshi.test.tengyue360.com/ path:/backend/student/stuApp/evaluate data:{content: test, courseId: 110, score: 5, anonymous: 1, evaluateObject: 1, timestamp: 1537426565722} 

Logs

DioError [DioErrorType.DEFAULT]: HttpException: Content size exceeds specified contentLength. 124 bytes written while expected 112. [{"content":"������","courseId":"110","score":3,"anonymous":"1","evaluateObject":"2","timestamp":"1537426578634"}]
I/flutter (14570): DioError [DioErrorType.DEFAULT]: HttpException: Content size exceeds specified contentLength. 124 bytes written while expected 112. [{"content":"������","courseId":"110","score":3,"anonymous":"1","evaluateObject":"2","timestamp":"1537426578634"}]
@BytesZero
Copy link
Author

If the parameter is Chinese, it will appear back in question.

@BytesZero
Copy link
Author

@wendux Thank you very much, the update is very fast. 666

@wendux wendux removed the processing label Sep 25, 2018
wendux pushed a commit that referenced this issue May 21, 2019
AlexV525 pushed a commit that referenced this issue Feb 13, 2023
<!-- Write down your pull request descriptions. -->

### New Pull Request Checklist

- [ ] I have read the
[Documentation](https://pub.dev/documentation/diox/latest/)
- [ ] I have searched for a similar pull request in the
[project](https://github.com/cfug/diox/pulls) and found none
- [ ] I have updated this branch with the latest `main` branch to avoid
conflicts (via merge from master or rebase)
- [ ] I have added the required tests to prove the fix/feature I'm
adding
- [ ] I have updated the documentation (if necessary)
- [ ] I have run the tests without failures

### Additional context and info (if any)

<!-- Provide more context and info about the PR. -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants