But what if the postID wasn't numeric and contained a forward slash? The URL would end up being something like destroy/mypost/4711.json whereas what we expected was destroy/mypost%2F4711.json. If we try to encode the parameter manually while concatenating the string, we end up with a double-escaped slash: destroy/mypost%252F4711.json. As of now, there doesn't seem to be any way to transmit a single encoded slash in the URL.
A good solution would be introducing path variables, like in Spring MVC. That could look something like this:
The current documented way of using path variables is as follows:
But what if the
postID
wasn't numeric and contained a forward slash? The URL would end up being something likedestroy/mypost/4711.json
whereas what we expected wasdestroy/mypost%2F4711.json
. If we try to encode the parameter manually while concatenating the string, we end up with a double-escaped slash:destroy/mypost%252F4711.json
. As of now, there doesn't seem to be any way to transmit a single encoded slash in the URL.A good solution would be introducing path variables, like in Spring MVC. That could look something like this:
This could be escaped and used exactly as the query map in URIBuilder.