[Twisted-Python] parsing url query parameters and values
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¶m2=val2&¶m3=val3 http://www.example.com/path?param1=val1¶m2=val2&som=|=val¶m3=val3 Ideally I could use something that bulds a dictionary of parameters and values
On Mon, 10 Mar 2008 16:14:54 +0100, Vasil Vangelovski <vvangelovski@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¶m2=val2&¶m3=val3 http://www.example.com/path?param1=val1¶m2=val2&som=|=val¶m3=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
Thanx alot. What I was looking for was cgi.parse_qs. I need that processing for a layer that is not connected to twisted. On Tue, Mar 11, 2008 at 1:26 PM, Maarten ter Huurne <maarten@treewalker.org> wrote:
On Monday 10 March 2008, Vasil Vangelovski wrote:
Is there any method in the Twisted or Twisted web api I can use to parse url query parameters and values.
If the query is part of a request being handled by twisted.web, you can simply use "Request.args".
Bye, Maarten
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
participants (3)
-
Jean-Paul Calderone -
Maarten ter Huurne -
Vasil Vangelovski