Breaking Down the URL

S
o the Python infrastructure (in particular, the translate handler, if you're interested) breaks down the URL from the HTTP request into a number of even smaller fragments.

The URL is broken down as shown in Figure 1. The scheme and server portions are self-explainatory. The script_path portion of the URL is the longest section of the path which corresponds to a Python script under docs/. So, for example, if there are Python scripts docs/path.py, docs/path/to.py, and docs/path/to/script/index.py, but not docs/path/to/script/arg1.py or anything longer, the Python infrastructure would break down the URL as shown in Figure 1.

http :// www.cs.uchicago.edu /path/to/script /arg1/arg2/arg3 ?foo=bar
scheme server script_path args_path internal or special
Figure 1: Breakdown of example URL.

Anything left between the end of the script_path and the end of the URL or a ? character is the args_path, and tells the Python script at script_path specifically what the user wants to see.

All paths of documentation are served up as HTML by the script docs/info/services/website/path.py. So in the current URL, /info/services/website/path is the script_path, and anything remaining after that is the args_path, which tells path.py which path, and possibly which body within that path, you wish to view.

If there's a question mark in the URL, it marks the beginning of the internal or special data. The data is internal if it has an = character in it, otherwise it is special. Internal data is used to perform actions--modifications to site content like adding, editing, or deleting. Special data triggers the execution of special Python scripts (ah! what an apt name!) which do things like change users' passwords, allow them to login and logout, change modes, etc.