$.ajax({
url: "/api/v1/cases/annotations/" + case_id + "/" + encodeURIComponent(current_plink),
Run Code Online (Sandbox Code Playgroud)
我正在使用encodeURIComponent来转义斜线。但这对我不起作用。此代码将“斜杠”转换为“%2F”,但是apache无法识别它。
我的PHP部分是这样的:
$app->get('/cases/annotations/:case_id/:prep_name', 'authenticatePathologist', function($case_id, $prep_name) use ($app) {
Run Code Online (Sandbox Code Playgroud)
您应该使用对其进行两次编码encodeURIComponent,即encodeURIComponent(encodeURIComponent(current_plink))。如果仅对其编码一次,则服务器将对其进行解码,这与完全不对其进行编码相同。
| 归档时间: |
|
| 查看次数: |
6017 次 |
| 最近记录: |