[Python-checkins] python/dist/src/Doc/lib liburllib.tex,1.46,1.47 liburllib2.tex,1.6,1.7
rhettinger@users.sourceforge.net
rhettinger@users.sourceforge.net
Thu, 24 Apr 2003 08:32:41 -0700
Update of /cvsroot/python/python/dist/src/Doc/lib
In directory sc8-pr-cvs1:/tmp/cvs-serv4720/Doc/lib
Modified Files:
liburllib.tex liburllib2.tex
Log Message:
SF Patch 549151: urllib2 POSTs on redirect
(contributed by John J Lee)
Index: liburllib.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/liburllib.tex,v
retrieving revision 1.46
retrieving revision 1.47
diff -C2 -d -r1.46 -r1.47
*** liburllib.tex 24 Apr 2003 02:31:14 -0000 1.46
--- liburllib.tex 24 Apr 2003 15:32:06 -0000 1.47
***************
*** 255,264 ****
\begin{classdesc}{FancyURLopener}{...}
\class{FancyURLopener} subclasses \class{URLopener} providing default
! handling for the following HTTP response codes: 301, 302 or 401. For
! 301 and 302 response codes, the \mailheader{Location} header is used to
! fetch the actual URL. For 401 response codes (authentication
! required), basic HTTP authentication is performed. For 301 and 302 response
! codes, recursion is bounded by the value of the \var{maxtries} attribute,
! which defaults 10.
The parameters to the constructor are the same as those for
--- 255,270 ----
\begin{classdesc}{FancyURLopener}{...}
\class{FancyURLopener} subclasses \class{URLopener} providing default
! handling for the following HTTP response codes: 301, 302, 303 and 401.
! For 301, 302 and 303 response codes, the \mailheader{Location} header
! is used to fetch the actual URL. For 401 response codes
! (authentication required), basic HTTP authentication is performed.
! For 301, 302 and 303 response codes, recursion is bounded by the value
! of the \var{maxtries} attribute, which defaults 10.
!
! \note{According to the letter of \rfc{2616}, 301 and 302 responses to
! POST requests must not be automatically redirected without
! confirmation by the user. In reality, browsers do allow automatic
! redirection of these responses, changing the POST to a GET, and
! \module{urllib} reproduces this behaviour.}
The parameters to the constructor are the same as those for
Index: liburllib2.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/liburllib2.tex,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** liburllib2.tex 9 Nov 2001 03:49:29 -0000 1.6
--- liburllib2.tex 24 Apr 2003 15:32:07 -0000 1.7
***************
*** 218,221 ****
--- 218,227 ----
\end{methoddesc}
+ \begin{methoddesc}[Request]{get_method}{}
+ Return a string indicating the HTTP request method. This is only
+ meaningful for HTTP requests, and currently always takes one of the
+ values ("GET", "POST").
+ \end{methoddesc}
+
\begin{methoddesc}[Request]{has_data}{}
Return whether the instance has a non-\code{None} data.
***************
*** 395,403 ****
\end{methoddesc}
-
\subsection{HTTPRedirectHandler Objects \label{http-redirect-handler}}
! \note{303 redirection is not supported by this version of
! \module{urllib2}.}
\begin{methoddesc}[HTTPRedirectHandler]{http_error_301}{req,
--- 401,428 ----
\end{methoddesc}
\subsection{HTTPRedirectHandler Objects \label{http-redirect-handler}}
! \note{Some HTTP redirections require action from this module's client
! code. If this is the case, \exception{HTTPError} is raised. See
! \rfc{2616} for details of the precise meanings of the various
! redirection codes.}
!
! \begin{methoddesc}[HTTPRedirectHandler]{redirect_request}{req,
! fp, code, msg, hdrs}
! Return a \class{Request} or \code{None} in response to a redirect.
! This is called by the default implementations of the
! \code{http_error_30x()} methods when a redirection is received from
! the server. If a redirection should take place, return a new
! \class{Request} to allow \code{http_error_30x()} to perform the
! redirect. Otherwise, raise \exception{HTTPError} if no other
! \class{Handler} should try to handle this URL, or return \code{None}
! if you can't but another \class{Handler} might.
!
! \note{The default implementation of this method does not strictly
! follow \rfc{2616}: it allows automatic 302 redirection of POST
! requests, because essentially all HTTP clients do this.}
!
! \end{methoddesc}
!
\begin{methoddesc}[HTTPRedirectHandler]{http_error_301}{req,
***************
*** 405,409 ****
Redirect to the \code{Location:} URL. This method is called by
the parent \class{OpenerDirector} when getting an HTTP
! permanent-redirect response.
\end{methoddesc}
--- 430,434 ----
Redirect to the \code{Location:} URL. This method is called by
the parent \class{OpenerDirector} when getting an HTTP
! `moved permanently' response.
\end{methoddesc}
***************
*** 411,417 ****
fp, code, msg, hdrs}
The same as \method{http_error_301()}, but called for the
! temporary-redirect response.
\end{methoddesc}
\subsection{ProxyHandler Objects \label{proxy-handler}}
--- 436,447 ----
fp, code, msg, hdrs}
The same as \method{http_error_301()}, but called for the
! `found' response.
\end{methoddesc}
+ \begin{methoddesc}[HTTPRedirectHandler]{http_error_303}{req,
+ fp, code, msg, hdrs}
+ The same as \method{http_error_301()}, but called for the
+ `see other' redirect response.
+ \end{methoddesc}
\subsection{ProxyHandler Objects \label{proxy-handler}}