具有特殊字符的Slim PHP路由不起作用

I've got the below SLIM php route:

$app->get('/suggest(/:filter)', 'getSuggestions');

It works fine when calling it as per below:

/suggest/query

But always breaks on more complicated, URI encoded queries

/suggest/my%20query
dongwen5336
dongwen5336 “破”是什么意思?请提供更详细的错误说明,日志条目等。
7 年多之前 回复

1个回答



苗条论坛围绕这些问题有很多回复 - 但很可能如果它不起作用,那就是你的GET调用(更有可能是 getSuggestions函数正在处理请求及其遇到的任何空间。如果没有看到更多的代码,您将获得的最佳答案是您没有正确计算空格。</ p>
</ div>

展开原文

原文

The slim forums have tons of responses around these issues - but most likely if it's not working, it's how your GET call (more likely the getSuggestions function is handling the request and any spaces it encounters. Without seeing more of that code, the best answer you will get is that your not accounting for spaces properly.

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问