zimmer
zimmer

Reputation: 1197

how to judge whether the parameters in URL in bottle?

for example, the URL:

http://localhost:8080/company?a=1

and how can i know whether the URL contains parameters a .

Upvotes: 1

Views: 677

Answers (1)

ron rothman
ron rothman

Reputation: 18128

Here's how you access a:

@route('/company')
def company():
    if bottle.request.params.get('a') is not None:
        # param "a" was present in the URI's query string

Upvotes: 2

Related Questions