Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
954b9adc
Commit
954b9adc
authored
Sep 28, 1998
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document new urllib features by Eric Raymond.
parent
9ab96d40
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
5 deletions
+22
-5
Doc/lib/liburllib.tex
Doc/lib/liburllib.tex
+22
-5
No files found.
Doc/lib/liburllib.tex
View file @
954b9adc
...
...
@@ -37,10 +37,17 @@ used at those few places where a true built-in file object is
required.)
The
\method
{
info()
}
method returns an instance of the class
\class
{
mimetools.Message
}
containing the headers received from the
server, if the protocol uses such headers (currently the only
supported protocol that uses this is HTTP). See the description of
the
\module
{
mimetools
}
\refstmodindex
{
mimetools
}
module.
\class
{
mimetools.Message
}
containing meta-information associated
with the URL. When the method is HTTP, these headers are those
returned by the server at the head of the retrieved HTML page
(including Content-Length and Content-Type). When the method is FTP,
a Content-Length header will be present if (as is now usual) the
server passed back a file length in response to the FTP retrieval
request. When the method is local-file, returned headers will include
a Date representing the file's last-modified time, a Content-Length
giving file size, and a Content-Type containing a guess at the file's
type. See also the description of the
\module
{
mimetools
}
\refstmodindex
{
mimetools
}
module.
If the
\var
{
url
}
uses the
\file
{
http:
}
scheme identifier, the optional
\var
{
data
}
argument may be given to specify a
\code
{
POST
}
request
...
...
@@ -50,7 +57,7 @@ see the \function{urlencode()} function below.
\end{funcdesc}
\begin{funcdesc}
{
urlretrieve
}{
url
}
\begin{funcdesc}
{
urlretrieve
}{
url
\optional
{
, filename
}
\optional
{
, hook
}}
}
Copy a network object denoted by a URL to a local file, if necessary.
If the URL points to a local file, or a valid cached copy of the
object exists, the object is not copied. Return a tuple
...
...
@@ -60,6 +67,16 @@ is either \code{None} (for a local object) or whatever the
\method
{
info()
}
method of the object returned by
\function
{
urlopen()
}
returned (for a remote object, possibly cached). Exceptions are the
same as for
\function
{
urlopen()
}
.
The second argument, if present, specifies the file location to copy
to (if absent, the location will be a tempfile with a generated name).
The third argument, if present, is a hook function that will be called
once on establishment of the network connection and once after each
block read thereafter. The hook will be passed three arguments; a
count of blocks transferred so far, a block size in bytes, and the
total size of the file. The third argument may be -1 on older FTP
servers which do not return a file size in response to a retrieval
request.
\end{funcdesc}
\begin{funcdesc}
{
urlcleanup
}{}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment