简体   繁体   中英

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM