I have defined multplie service urls , all of which will execute same code.
@service.route('/get_info/env=<path:env>/starttime=<int:starttime>/endtime=<int:endtime>/entire=<entire>/over=<over>/stage=<stage>', defaults={'name': None}, strict_slashes=False)
@service.route('/get_info/dir=<path:dir>/starttime=<int:starttime>/endtime=<int:endtime>/entire=<entire>/over=<over>', defaults={'stage': 'ABC', 'name': None}, strict_slashes=False)
@servicelog.operation('GetInfo')
def get_deployment_info(env, starttime, endtime, finished, stage, fleetwide, hostname):
global _misc
try:
log.info("Dir: %s, Starttime: %d, Endtime: %d, name: %s, finished:%s, Stage:%s, Fleetwide: %s", dir, starttime, endtime, name,over, stage, entire)
result = obj.get_info(dir, starttime, endtime, entire, over, stage, name)
If I were to invoke the service with below parameters, it works as expected:
http://<endpoint>/get_info/dir=home/user/test/starttime=1470439200/endtime=1470856027/entire=true/over=true
However if I get invoke the service with below parameters, I get a re-direct message:
http://<endpoint>/get_info/dir=home/user/test/starttime=1470439200/endtime=1470856027/entire=true/over=true/stage=ABC
The error I get is
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>Redirecting...</title>
<h1>Redirecting...</h1>
<p>You should be redirected automatically to target URL: <a href="http://endpoint/get_info/dir%3Dhome/user/test/starttime%3D1470439200/endtime%3D1470856027/entire%3Dtrue/over%3Dtrue">http://endpoint/get_info/dir%3Dhome/user/test/starttime%3D1470439200/endtime%3D1470856027/entire%3Dtrue/over%3Dtrue</a>. If not click the link.%
Am I doing something incorrect here? I am not expecting such a message as I have not defined any sort of redirection. It should execute the method irrespective of which url is used.