I have the following issue which I do not know how to resolve.
I have the following route on a api I am using :
'router' => [
'routes' => [
'test' => [
'type' => 'regex',
'options' => [
'regex' => '/test(?<json>\/.*)?',
'defaults' => [
'controller' => TestController::class,
'action' => 'checkJson',
'json' => '',
],
'spec' => '/path%path%'
],
],
],
],
The idea is to catch all requests ending in a json string /test/[{"this is an example":1}]
. This really works but the problem is, I would also like to accept when the input gets encoded like :
/test/%5B%7B%22this%20is%20an%20example%22%3A1%7D%5D
Any idea of how can I achieve what I am expecting ?
When the request is made using an encoded url, I get the following error in the browser :
Not Found
The requested URL /stock//test/[{"this is an example":1}] was not found on this server.
Any idea of how can I resolve this easily ?
Thank you