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

微信的body有空格的时候会导致“body参数格式错误的问题” #6

Open
robotzhang opened this issue May 25, 2015 · 5 comments

Comments

@robotzhang
Copy link

微信的body有空格的时候会导致“body参数格式错误的问题”
解决方法是可以将body的空格去除,或者转义成%20。至于其他特殊的url字符(+,/,?,%,#,&,=等特殊符号)未做测试。是否需要在请求的时候将body特殊字符转义?

@jasl
Copy link
Owner

jasl commented May 30, 2015

抱歉,我还没测试过,让我想办法测试一下,按文档里,我印象里是说不需要转义

@xuyao91
Copy link

xuyao91 commented Dec 1, 2015

空格不会引起“body参数格式错误的问题”,我测试了几个,(. / ?%等 )会引起“body参数格式错误”的问题

@jasl
Copy link
Owner

jasl commented Dec 1, 2015

过滤掉符号? 不过我个人建议库不处理,写到文档里 使用的时候注意下

@xuyao91
Copy link

xuyao91 commented Dec 1, 2015

这个看人个处理吧,但还是要想个方法解决一下,万一有人真的输入了特殊字符,那就出错了,而且会输特殊字符进来的人肯定不在少数。

@jasl
Copy link
Owner

jasl commented Dec 1, 2015

转义也不是好办法 到微信那边后 显示成什么效果 符不符合预期 都是不好说的
而且输入的值也是跟业务相关的,最好能从业务角度避免

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

3 participants