How do you accept a URL in a Python Bottle server?
source link: https://www.codesd.com/item/how-do-you-accept-a-url-in-a-python-bottle-server.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
How do you accept a URL in a Python Bottle server?
Using a Bottle Sehttp://bottlepy.org/docs/dev/routing.html#wildcard-filters
I'd like to accept any url, and then do something with the url.
@bottle.route("/<url:path>")
def index(url):
return "Your url is " + url
This is tricky because URLs have slashes in them, and Bottle splits by slashes.
Based on new Bottle (v0.10), use a re filter:
@bottle.route("/<url:re:.+>")
You can do that with old parameters too:
@bottle.route("/:url#.+#")
Related Articles
How do you make a URL string in asp.net MVC
How do you check your URL for SQL injection attacks?
How do you store an AD byte string in SQL SERVER?
In Ruby, how do you print the URL settings and server environment variables?
How would you format this URL, it gives me the illegal character in the path to the index 70 & rdquo;
In Python, how do you accept integers as parameters?
How can you find the URL used in the default initialization of log4j?
How do you get the URLs to display with a slash at the end?
With Spring 3.1, How do you test the urls of your controllers?
In Django, how do you write the URL template for '/' and other root-based URLs
How do you write a custom class in python using different objects?
How do you store formatted strings in a Python configuration file?
How can you do a complete external join in sql server 2005?
How do you apply one on 2 tables in SQL Server?
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK