ServiceStack Handler Not Found When Periods Present in Path

吃可爱长大的小学妹 提交于 2019-12-12 20:49:15

问题


When doing a GET with an email address (periods present) in the middle of the path we are getting an error from ServiceStack saying "Handler for Request Not Found". When moving the email address portion of the route to the last section of the path it is successful.

  • Fails "/path/to/me%40example.com/action"
  • Success "/path/to/action/me%40example.com"

We have been able to work around it by keeping the email address at the end of the path, but when there is more than one parameter with the potential of having periods we have to rely on a POST to accomplish the call. Any suggestions for work-arounds?


回答1:


There are 2 component separators in ServiceStack's Routes: . and /, here's an example showing different Route path ServiceStack supports.

You can try url encoding the . so its %2E otherwise just add the action as a querystring parameter, e.g: /path/to/me%40example.com?action=action



来源:https://stackoverflow.com/questions/12866145/servicestack-handler-not-found-when-periods-present-in-path

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!