accessing URL query string

22 views
Skip to first unread message

Eric S. Johansson

unread,
Nov 21, 2015, 12:51:21 PM11/21/15
to brython
I'm trying to access the query string embedded in the URL from brython.  ( i.e. http://foo.com/qwe?custID=myshop)  but when I use the  method below, it  always returns none and if I  Change the code toaccess the key value directly, it throws an exception saying  the keyvalue doesn't exist.

def customer_ID_query ():
    """to see if there was a customer ID past on the URL and return the
    value or None
    """
    customer_ID_value = document.query.getvalue("custID", None)
    return customer_ID_value

  2 questions are: what am I missing and how do I debug this?

Pierre Quentel

unread,
Nov 21, 2015, 4:39:35 PM11/21/15
to brython
Eric,

Thanks for reporting this ; there was a bug in method getvalue that I just fixed in the Github repository. The other methods and the syntax document.query['custID'] should work.

Generally, the best place to report bugs is the issue tracker on the Github site, it's easier to follow, but it's ok to report here also.

Reply all
Reply to author
Forward
0 new messages