Python – Bottle – Is it possible to retrieve URLs without parameters?

Bottle – Is it possible to retrieve URLs without parameters?… here is a solution to the problem.

Bottle – Is it possible to retrieve URLs without parameters?

I have a URL of the form:

http://www.foo.com/bar?arg1=x&arg2=y

If I do:

request.url

I get:

http://www.foo.com/bar?arg1=x&arg2=y

Can I just get http://www.foo.com/bar?

Solution

It looks like request.urlparts.path might be one way.

Full documentation here

Related Problems and Solutions