QueryString 中带有空格的 GET 请求会导致代码崩溃
简而言之,我的代码工作正常并从 GET 请求返回 JSON,但是当 QueryString 的值对之一中有空格时,服务将关闭。即使在 IDE 中调试时也不会引发异常,但使用 Fiddler 执行 GET 请求时我会收到“HTTP 错误 400 - 错误请求” - 可能是因为服务器刚刚关闭(Visual Studio 开发服务器)。
Simply put my code is working fine and returning JSON from GET requests, but when there is a space in one of the value pairs of the QueryString the Service shuts down. Even when debugging in the IDE no exception is thrown, although, using Fiddler to perform the GET request I get back a "HTTP Error 400 - Bad Request" - probably because the server's just shut down (the Visual Studio development Server).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
空格不是查询字符串的合法部分,应替换为 +(加号)
Spaces aren't a legal part of the querystring, and should be replaced with a + (plus sign)