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
b98e96a2
Commit
b98e96a2
authored
Feb 07, 2013
by
Senthil Kumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Issue17069: Document getcode method in urllib.request.rst
parent
1acaf0bc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
Doc/library/urllib.request.rst
Doc/library/urllib.request.rst
+12
-4
No files found.
Doc/library/urllib.request.rst
View file @
b98e96a2
...
@@ -57,16 +57,24 @@ The :mod:`urllib.request` module defines the following functions:
...
@@ -57,16 +57,24 @@ The :mod:`urllib.request` module defines the following functions:
If neither *cafile* nor *capath* is specified, an HTTPS request
If neither *cafile* nor *capath* is specified, an HTTPS request
will not do any verification of the server's certificate.
will not do any verification of the server's certificate.
This function returns a file-like object that works as a :term:`context manager`,
For http and https urls, this function returns a
with two additional methods from the :mod:`urllib.response` module
:class:`http.client.HTTPResponse` object which has the following
:ref:`httpresponse-objects` methods.
* :meth:`geturl` --- return the URL of the resource retrieved,
For ftp, file, data urls and requests are explicity handled by legacy
:class:`URLopener` and :class:`FancyURLopener` class, this function returns
an :class:`urllib.response.addinfourl` object which can work as
:term:`context manager` and has methods such as
* :meth:`~urllib.response.addinfourl.geturl` --- return the URL of the resource retrieved,
commonly used to determine if a redirect was followed
commonly used to determine if a redirect was followed
* :meth:`info` --- return the meta-information of the page, such as headers,
* :meth:`
~urllib.response.addinfourl.
info` --- return the meta-information of the page, such as headers,
in the form of an :func:`email.message_from_string` instance (see
in the form of an :func:`email.message_from_string` instance (see
`Quick Reference to HTTP Headers
<http:
//
www
.
cs
.
tut
.
fi
/~
jkorpela
/
http
.
html
>
`_)
`Quick Reference to HTTP Headers
<http:
//
www
.
cs
.
tut
.
fi
/~
jkorpela
/
http
.
html
>
`_)
* :meth:`~urllib.response.addinfourl.getcode` -- return the HTTP status code of the response.
Raises :exc:`URLError` on errors.
Raises :exc:`URLError` on errors.
Note that ``None`` may be returned if no handler handles the request (though
Note that ``None`` may be returned if no handler handles the request (though
...
...
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