Changeset 972
- Timestamp:
- 02/16/06 06:00:48
- Files:
-
- trunk/cherrypy/_cperror.py (modified) (2 diffs)
- trunk/cherrypy/_cphttptools.py (modified) (3 diffs)
- trunk/cherrypy/lib/httptools.py (modified) (1 diff)
- trunk/docs/book/xml/apireference.xml (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/_cperror.py
r897 r972 40 40 if params is not None: 41 41 if isinstance(params, basestring): 42 request.queryString = params 42 request.query_string = params 43 request.queryString = request.query_string # Backward compatibility 43 44 pm = cgi.parse_qs(params, keep_blank_values=True) 44 45 for key, val in pm.items(): … … 47 48 request.params = pm 48 49 else: 49 request.queryString = urllib.urlencode(params) 50 request.query_string = urllib.urlencode(params) 51 request.queryString = request.query_string 50 52 request.params = params.copy() 51 53 trunk/cherrypy/_cphttptools.py
r957 r972 132 132 133 133 self.path = path 134 self.queryString = qs 134 self.query_string = qs 135 self.queryString = qs # Backward compatibility 135 136 self.protocol = proto 136 137 … … 164 165 def processHeaders(self): 165 166 166 self.params = httptools.parseQueryString(self.query String)167 self.params = httptools.parseQueryString(self.query_string) 167 168 self.paramMap = self.params # Backward compatibility 168 169 … … 201 202 def _get_browser_url(self): 202 203 url = self.base + self.path 203 if self.query String:204 url += '?' + self.query String204 if self.query_string: 205 url += '?' + self.query_string 205 206 return url 206 207 browser_url = property(_get_browser_url, trunk/cherrypy/lib/httptools.py
r961 r972 335 335 return method, path, qs, protocol 336 336 337 def parseQueryString(query String, keep_blank_values=True):338 """Build a paramMap dictionary from a query String."""339 if re.match(r"[0-9]+,[0-9]+", query String):337 def parseQueryString(query_string, keep_blank_values=True): 338 """Build a paramMap dictionary from a query_string.""" 339 if re.match(r"[0-9]+,[0-9]+", query_string): 340 340 # Server-side image map. Map the coords to 'x' and 'y' 341 341 # (like CGI::Request does). 342 pm = query String.split(",")342 pm = query_string.split(",") 343 343 pm = {'x': int(pm[0]), 'y': int(pm[1])} 344 344 else: 345 pm = cgi.parse_qs(query String, keep_blank_values)345 pm = cgi.parse_qs(query_string, keep_blank_values) 346 346 for key, val in pm.items(): 347 347 if len(val) == 1: trunk/docs/book/xml/apireference.xml
r969 r972 94 94 </section> 95 95 <section> 96 <title>cherrypy.request.query String</title>96 <title>cherrypy.request.query_string</title> 97 97 <para>This attribute is a string containing the query string of the request (the part of 98 98 the URL following '?').</para> … … 472 472 </section> 473 473 <section> 474 <title>parseQueryString(query String, keep_blank_values=True)</title>474 <title>parseQueryString(query_string, keep_blank_values=True)</title> 475 475 <para>Returns a dict of <code>{'key': 'value'}</code> pairs from an HTTP "key=value" 476 476 query string. Also handles server-side image map query strings. The default Request

