I am implementing REST web API. Some data is in request body as JSON, some other into URL itself, e.g. http://myhost/webapp/api/series/GMT/OTHER-DATA
.
The key parameter here is GMT that is the timezone identifier.
The problem happens when time zone identifier contains slash, e.g. Europe/London
. Since slash is a special character I encoded the parameter, so I got http://myhost/webapp/api/series/Europe%2FLondon/OTHER-DATA
.
And my (web) client failed to reach server and got 404. I changed method from POST to get and saw that everything works fine.
Since I have to use POST here I found some ugly work-around for now but it is interesting to know why does it happen?
I am using Spring MVC but I do not think it is relevant here: I tried to put breakpoint into Spring's DispatcherServlet
and in several Spring's HTTP filters that are usually invoked when everything is going well and I did not see that even one of them is called when URL contains %2F
.
I did yet another experiment. I tried to use %20
(space) instead and saw that it works fine with GET and does not work with POST.
I'd be appreciate to know if there is a "good" solution for the problem?