url ended with digital cause webpy failure

55 views
Skip to first unread message

Woody Wu

unread,
Apr 26, 2015, 12:02:05 PM4/26/15
to we...@googlegroups.com
Hi,

My url structure has entry:
    '/api/netinterfaces(.*)',    'Net_interfaces',

With this, I can access my service via http://host/api/netinterfaces or http://host/api/netinterfaces/1, and so on.  But I cannot access via http://host/api/netinterface/0 or http://host/api/netinterface/xxx0.  Actually, any URL ended with 0 does not work.  The webpy reported following error:

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
  <title>503 - Service Not Available</title>
 </head>
 <body>
  <h1>503 - Service Not Available</h1>
 </body>
</html>

What's wrong with the URLs?  Thanks in advance.

-woody


Xeriab Nabil

unread,
Oct 24, 2015, 4:59:55 AM10/24/15
to web.py
TIP: Try to use (\d+) in route name to tell the handler to use numbers!

"/api/netinterface(\d+)", "HandlerName"

Sven Boden

unread,
Nov 23, 2015, 11:35:29 AM11/23/15
to web.py

If you do it like in your mail, maybe it's the difference between 'netinterface' and 'netinterfaces' which is tripping you up, not the the 0.

Regards,
Sven

Op zondag 26 april 2015 18:02:05 UTC+2 schreef Woody Wu:
Reply all
Reply to author
Forward
0 new messages