[Twisted-Python] parsing url query parameters and values

Jean-Paul Calderone exarkun at divmod.com
Mon Mar 10 11:33:17 EDT 2008


On Mon, 10 Mar 2008 16:14:54 +0100, Vasil Vangelovski <vvangelovski at gmail.com> wrote:
>Is there any method in the Twisted or Twisted web api I can use to
>parse url query parameters and values. This isn't a very naive
>algorithm since there are more complicated query strings that can be
>constructed, for example:
>http://www.example.com/path?param1=val1&param2=val2&&param3=val3
>http://www.example.com/path?param1=val1&param2=val2&som=|=val&param3=val3
>Ideally I could use something that bulds a dictionary of parameters and values

See the stdlib APIs urlparse.urlparse and cgi.parse_qs.

Jean-Paul




More information about the Twisted-Python mailing list