HTTP request with escaped forward slashes in the URL
<p>I am sending an Ajax request to a REST API based on Slim.  How can I include a forward slash in one of the arguments (i.e. named placeholders in the URL)?  For instance, given the following ajax call, I want the values shown as comments in the PHP endpoint.  I recognize I can change to put resource as a parameter, but I would rather not as I use this approach successfully where the arguments are integers and wish to remain consistent.</p>

<pre><code>//$('#id').val() = 123
//$(this).prev().text() = https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent
$.ajax({
    type:'DELETE',
    url:'/1.0/editor/'+$('#id').val()+'/'+encodeURIComponent($(this).prev().text())
});
</code></pre>

<p>Slim endpoint</p>

<pre><code>$app-&gt;delete('/1.0/editor/{id}/{resource}', function (Request $request, Response $response,$args) {
    //args['id']=123
    //$args['resource']="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent"
});
</code></pre>