문제

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top