From cdd8151a08bca8b6fd873bb947b651e0747fc401 Mon Sep 17 00:00:00 2001 From: kgriffs Date: Thu, 4 Apr 2013 10:08:58 -0400 Subject: [PATCH] doc: Added note about query strings not having preceding '?' char --- falcon/request.py | 3 ++- falcon/testing/helpers.py | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/falcon/request.py b/falcon/request.py index 3d3d164..747370d 100644 --- a/falcon/request.py +++ b/falcon/request.py @@ -46,7 +46,8 @@ class Request(object): Attributes: method: HTTP method requested (e.g., GET, POST, etc.) path: Path portion of the request URL (not including query string). - query_string: Query string portion of the request URL. + query_string: Query string portion of the request URL, without + the preceding '?' character. stream: Stream-like object for reading the body of the request, if any. """ diff --git a/falcon/testing/helpers.py b/falcon/testing/helpers.py index 7848751..5ff493c 100644 --- a/falcon/testing/helpers.py +++ b/falcon/testing/helpers.py @@ -60,11 +60,12 @@ def create_environ(path='/', query_string='', protocol='HTTP/1.1', port='80', headers=None, app='', body='', method='GET', wsgierrors=None): - """ Creates a 'mock' PEP-333 environ dict for simulating WSGI requests + """ Creates a 'mock' PEP-3333 environ dict for simulating WSGI requests Args: path: The path for the request (default '/') - query_string: The query string to simulate (default '') + query_string: The query string to simulate, without a + leading '?' (default '') protocol: The HTTP protocol to simulate (default 'HTTP/1.1') port: The TCP port to simulate (default '80') headers: Optional headers to set as a dict or an iterable of tuples