diff options
| author | Casey Duncan <casey.duncan@gmail.com> | 2010-12-06 08:17:31 -0700 |
|---|---|---|
| committer | Casey Duncan <casey.duncan@gmail.com> | 2010-12-06 08:17:31 -0700 |
| commit | d2da2ee8333b7d134b3a50d5dd43c72ba029522f (patch) | |
| tree | 1c0bc3f52263d1bb31ce216e8132abb8914bdb6f /docs/narr | |
| parent | 4ba3856046051fcb55585ab69fc5043a50c059a1 (diff) | |
| parent | b4ddae4694c94a9b1281aab9f3ca5f21979d203b (diff) | |
| download | pyramid-d2da2ee8333b7d134b3a50d5dd43c72ba029522f.tar.gz pyramid-d2da2ee8333b7d134b3a50d5dd43c72ba029522f.tar.bz2 pyramid-d2da2ee8333b7d134b3a50d5dd43c72ba029522f.zip | |
Merge https://github.com/Pylons/pyramid
Diffstat (limited to 'docs/narr')
| -rw-r--r-- | docs/narr/webob.rst | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/docs/narr/webob.rst b/docs/narr/webob.rst index 92de9d409..c4805df8d 100644 --- a/docs/narr/webob.rst +++ b/docs/narr/webob.rst @@ -124,19 +124,39 @@ URLs In addition to these attributes, there are several ways to get the URL of the request. I'll show various values for an example URL -``http://localhost/app/?id=10``, where the application is mounted at +``http://localhost/app/blog?id=10``, where the application is mounted at ``http://localhost/app``. ``req.url``: The full request URL, with query string, e.g., - ``http://localhost/app/?id=10`` + ``http://localhost/app/blog?id=10`` + +``req.host``: + The host information in the URL, e.g., + ``localhost`` + +``req.host_url``: + The URL with the host, e.g., ``http://localhost`` ``req.application_url``: The URL of the application (just the SCRIPT_NAME portion of the path, not PATH_INFO). E.g., ``http://localhost/app`` -``req.host_url``: - The URL with the host, e.g., ``http://localhost`` +``req.path_url``: + The URL of the application including the PATH_INFO. e.g., + ``http://localhost/app/blog`` + +``req.path``: + The URL including PATH_INFO without the host or scheme. e.g., + ``/app/blog`` + +``req.path_qs``: + The URL including PATH_INFO and the query string. e.g, + ``/app/blog?id=10`` + +``req.query_string``: + The query string in the URL, e.g., + ``id=10`` ``req.relative_url(url, to_application=False)``: Gives a URL, relative to the current URL. If ``to_application`` |
