Search code examples
phpapirestrestler

PHP - Restler returns 404 when I put a value that contains a slash


I am using Restler and I have a function that receive a string. That string may contain a slash. Example: "/a/b/id"

http://test/test.json//a/b/id

Whenever I use a slash in the field it returns a 404

I am sure that the value will return something, but i really need to use slash in the string.

If I try to use the id by itself, no slash, it returns the correct value, but to do that I put the slashs hardcoded (not cool)

http://test/test.json/id

Any tips?

Is this a bug?

thanks


Solution

  • When you know that your parameter may contain slash, avoid using them as url parameter

    make them as query string or body parameter instead

    here is an example http://restler3.luracast.com/examples/_001_helloworld/say/hello?to=slash/slash