[Python编程(第4版)].(Programming.Python.4th.Edition).Mark.Lutz.文字版

(yzsuai) #1

Notice the URL in this page’s address field—the browser translated the / character we
typed into the selection page to a %2F hexadecimal escape code before adding it to the
end of the URL as a parameter. We met URL escape codes like this earlier in this chapter.
In this case, the browser did the translation for us, but the end result is as if we had
manually called one of the urllib.parse quoting functions on the file path string.


Technically, the %2F escape code here represents the standard URL translation for non-
ASCII characters, under the default encoding scheme browsers employ. Spaces are


Figure 15-34. Putfile response page


Figure 15-35. Verifying putfile with getfile—selection


Transferring Files to Clients and Servers | 1223
Free download pdf