<!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN">
<link rel=
"STYLESHEET" href=
"lib.css" type='text/css'
/>
<link rel=
"SHORTCUT ICON" href=
"../icons/pyfav.png" type=
"image/png" />
<link rel='start' href='../index.html' title='Python Documentation Index'
/>
<link rel=
"first" href=
"lib.html" title='Python Library Reference'
/>
<link rel='contents' href='contents.html'
title=
"Contents" />
<link rel='index' href='genindex.html' title='Index'
/>
<link rel='last' href='about.html' title='About this document...'
/>
<link rel='help' href='about.html' title='About this document...'
/>
<link rel=
"next" href=
"module-ftplib.html" />
<link rel=
"prev" href=
"module-urllib2.html" />
<link rel=
"parent" href=
"internet.html" />
<link rel=
"next" href=
"httpconnection-objects.html" />
<meta name='aesop' content='information'
/>
<title>11.6 httplib -- HTTP protocol client
</title>
<div id='top-navigation-panel' xml:id='top-navigation-panel'
>
<table align=
"center" width=
"100%" cellpadding=
"0" cellspacing=
"2">
<td class='online-navigation'
><a rel=
"prev" title=
"11.5.22 Examples"
href=
"urllib2-examples.html"><img src='../icons/previous.png'
border='
0' height='
32' alt='Previous Page' width='
32'
/></A></td>
<td class='online-navigation'
><a rel=
"parent" title=
"11. Internet Protocols and"
href=
"internet.html"><img src='../icons/up.png'
border='
0' height='
32' alt='Up One Level' width='
32'
/></A></td>
<td class='online-navigation'
><a rel=
"next" title=
"11.6.1 HTTPConnection Objects"
href=
"httpconnection-objects.html"><img src='../icons/next.png'
border='
0' height='
32' alt='Next Page' width='
32'
/></A></td>
<td align=
"center" width=
"100%">Python Library Reference
</td>
<td class='online-navigation'
><a rel=
"contents" title=
"Table of Contents"
href=
"contents.html"><img src='../icons/contents.png'
border='
0' height='
32' alt='Contents' width='
32'
/></A></td>
<td class='online-navigation'
><a href=
"modindex.html" title=
"Module Index"><img src='../icons/modules.png'
border='
0' height='
32' alt='Module Index' width='
32'
/></a></td>
<td class='online-navigation'
><a rel=
"index" title=
"Index"
href=
"genindex.html"><img src='../icons/index.png'
border='
0' height='
32' alt='Index' width='
32'
/></A></td>
<div class='online-navigation'
>
<b class=
"navlabel">Previous:
</b>
<a class=
"sectref" rel=
"prev" href=
"urllib2-examples.html">11.5.22 Examples
</A>
<b class=
"navlabel">Up:
</b>
<a class=
"sectref" rel=
"parent" href=
"internet.html">11. Internet Protocols and
</A>
<b class=
"navlabel">Next:
</b>
<a class=
"sectref" rel=
"next" href=
"httpconnection-objects.html">11.6.1 HTTPConnection Objects
</A>
<!--End of Navigation Panel-->
<H1><A NAME=
"SECTION0013600000000000000000">
11.6 <tt class=
"module">httplib
</tt> --
<A NAME=
"module-httplib"></A>
<a id='l2h-
3296' xml:id='l2h-
3296'
></a><a id='l2h-
3314' xml:id='l2h-
3314'
></a>
This module defines classes which implement the client side of the
HTTP and HTTPS protocols. It is normally not used directly -- the
module
<tt class=
"module"><a href=
"module-urllib.html">urllib
</a></tt><a id='l2h-
3315' xml:id='l2h-
3315'
></a> uses it to handle URLs
<div class=
"note"><b class=
"label">Note:
</b>
HTTPS support is only available if the
<tt class=
"module"><a href=
"module-socket.html">socket
</a></tt> module was
compiled with SSL support.
<div class=
"note"><b class=
"label">Note:
</b>
The public interface for this module changed substantially in Python
2.0. The
<tt class=
"class">HTTP
</tt> class is retained only for backward
compatibility with
1.5.2. It should not be used in new code. Refer
to the online docstrings for usage.
The module provides the following classes:
<dl><dt><table cellpadding=
"0" cellspacing=
"0"><tr valign=
"baseline">
<td><nobr><b><span class=
"typelabel">class
</span> <tt id='l2h-
3297' xml:id='l2h-
3297'
class=
"class">HTTPConnection
</tt></b>(
</nobr></td>
<td><var>host
</var><big>[
</big><var>, port
</var><big>]
</big><var></var>)
</td></tr></table></dt>
An
<tt class=
"class">HTTPConnection
</tt> instance represents one transaction with an HTTP
server. It should be instantiated passing it a host and optional port number.
If no port number is passed, the port is extracted from the host string if it
has the form
<code><var>host
</var>:
<var>port
</var></code>, else the default HTTP port (
80) is
used. For example, the following calls all create instances that connect to
the server at the same host and port:
<div class=
"verbatim"><pre>
>>> h1 = httplib.HTTPConnection('www.cwi.nl')
>>> h2 = httplib.HTTPConnection('www.cwi.nl:
80')
>>> h3 = httplib.HTTPConnection('www.cwi.nl',
80)
<span class=
"versionnote">New in version
2.0.
</span>
<dl><dt><table cellpadding=
"0" cellspacing=
"0"><tr valign=
"baseline">
<td><nobr><b><span class=
"typelabel">class
</span> <tt id='l2h-
3298' xml:id='l2h-
3298'
class=
"class">HTTPSConnection
</tt></b>(
</nobr></td>
<td><var>host
</var><big>[
</big><var>, port, key_file, cert_file
</var><big>]
</big><var></var>)
</td></tr></table></dt>
A subclass of
<tt class=
"class">HTTPConnection
</tt> that uses SSL for communication with
secure servers. Default port is
<code>443</code>.
the name of a PEM formatted file that contains your private
key.
<var>cert_file
</var> is a PEM formatted certificate chain file.
<span class=
"warning"><b class=
"label">Warning:
</b>
This does not do any certificate verification!
</span>
<span class=
"versionnote">New in version
2.0.
</span>
<dl><dt><table cellpadding=
"0" cellspacing=
"0"><tr valign=
"baseline">
<td><nobr><b><span class=
"typelabel">class
</span> <tt id='l2h-
3299' xml:id='l2h-
3299'
class=
"class">HTTPResponse
</tt></b>(
</nobr></td>
<td><var>sock
</var><big>[
</big><var>, debuglevel=
0</var><big>]
</big><var></var><big>[
</big><var>, strict=
0</var><big>]
</big><var></var>)
</td></tr></table></dt>
Class whose instances are returned upon successful connection. Not
instantiated directly by user.
<span class=
"versionnote">New in version
2.0.
</span>
The following exceptions are raised as appropriate:
<dl><dt><b><span class=
"typelabel">exception
</span> <tt id='l2h-
3300' xml:id='l2h-
3300'
class=
"exception">HTTPException
</tt></b></dt>
The base class of the other exceptions in this module. It is a
subclass of
<tt class=
"exception">Exception
</tt>.
<span class=
"versionnote">New in version
2.0.
</span>
<dl><dt><b><span class=
"typelabel">exception
</span> <tt id='l2h-
3301' xml:id='l2h-
3301'
class=
"exception">NotConnected
</tt></b></dt>
A subclass of
<tt class=
"exception">HTTPException
</tt>.
<span class=
"versionnote">New in version
2.0.
</span>
<dl><dt><b><span class=
"typelabel">exception
</span> <tt id='l2h-
3302' xml:id='l2h-
3302'
class=
"exception">InvalidURL
</tt></b></dt>
A subclass of
<tt class=
"exception">HTTPException
</tt>, raised if a port is given and is
either non-numeric or empty.
<span class=
"versionnote">New in version
2.3.
</span>
<dl><dt><b><span class=
"typelabel">exception
</span> <tt id='l2h-
3303' xml:id='l2h-
3303'
class=
"exception">UnknownProtocol
</tt></b></dt>
A subclass of
<tt class=
"exception">HTTPException
</tt>.
<span class=
"versionnote">New in version
2.0.
</span>
<dl><dt><b><span class=
"typelabel">exception
</span> <tt id='l2h-
3304' xml:id='l2h-
3304'
class=
"exception">UnknownTransferEncoding
</tt></b></dt>
A subclass of
<tt class=
"exception">HTTPException
</tt>.
<span class=
"versionnote">New in version
2.0.
</span>
<dl><dt><b><span class=
"typelabel">exception
</span> <tt id='l2h-
3305' xml:id='l2h-
3305'
class=
"exception">UnimplementedFileMode
</tt></b></dt>
A subclass of
<tt class=
"exception">HTTPException
</tt>.
<span class=
"versionnote">New in version
2.0.
</span>
<dl><dt><b><span class=
"typelabel">exception
</span> <tt id='l2h-
3306' xml:id='l2h-
3306'
class=
"exception">IncompleteRead
</tt></b></dt>
A subclass of
<tt class=
"exception">HTTPException
</tt>.
<span class=
"versionnote">New in version
2.0.
</span>
<dl><dt><b><span class=
"typelabel">exception
</span> <tt id='l2h-
3307' xml:id='l2h-
3307'
class=
"exception">ImproperConnectionState
</tt></b></dt>
A subclass of
<tt class=
"exception">HTTPException
</tt>.
<span class=
"versionnote">New in version
2.0.
</span>
<dl><dt><b><span class=
"typelabel">exception
</span> <tt id='l2h-
3308' xml:id='l2h-
3308'
class=
"exception">CannotSendRequest
</tt></b></dt>
A subclass of
<tt class=
"exception">ImproperConnectionState
</tt>.
<span class=
"versionnote">New in version
2.0.
</span>
<dl><dt><b><span class=
"typelabel">exception
</span> <tt id='l2h-
3309' xml:id='l2h-
3309'
class=
"exception">CannotSendHeader
</tt></b></dt>
A subclass of
<tt class=
"exception">ImproperConnectionState
</tt>.
<span class=
"versionnote">New in version
2.0.
</span>
<dl><dt><b><span class=
"typelabel">exception
</span> <tt id='l2h-
3310' xml:id='l2h-
3310'
class=
"exception">ResponseNotReady
</tt></b></dt>
A subclass of
<tt class=
"exception">ImproperConnectionState
</tt>.
<span class=
"versionnote">New in version
2.0.
</span>
<dl><dt><b><span class=
"typelabel">exception
</span> <tt id='l2h-
3311' xml:id='l2h-
3311'
class=
"exception">BadStatusLine
</tt></b></dt>
A subclass of
<tt class=
"exception">HTTPException
</tt>. Raised if a server responds with a
HTTP status code that we don't understand.
<span class=
"versionnote">New in version
2.0.
</span>
The constants defined in this module are:
<dl><dt><b><tt id='l2h-
3312' xml:id='l2h-
3312'
>HTTP_PORT
</tt></b></dt>
The default port for the HTTP protocol (always
<code>80</code>).
<dl><dt><b><tt id='l2h-
3313' xml:id='l2h-
3313'
>HTTPS_PORT
</tt></b></dt>
The default port for the HTTPS protocol (always
<code>443</code>).
and also the following constants for integer status codes:
<div class=
"center"><table class=
"realtable">
<th class=
"left" >Constant
</th>
<th class=
"center">Value
</th>
<th class=
"left" >Definition
</th>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">CONTINUE
</tt></td>
<td class=
"center"><code>100</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.1.1"
>RFC
2616, Section
10.1.1</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">SWITCHING_PROTOCOLS
</tt></td>
<td class=
"center"><code>101</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.1.2"
>RFC
2616, Section
10.1.2</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">PROCESSING
</tt></td>
<td class=
"center"><code>102</code></td>
<td class=
"left" >WEBDAV,
<a class=
"ulink" href=
"http://www.webdav.org/specs/rfc2518.html#STATUS_102"
>RFC
2518, Section
10.1</a></td></tr><P>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">OK
</tt></td>
<td class=
"center"><code>200</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1"
>RFC
2616, Section
10.2.1</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">CREATED
</tt></td>
<td class=
"center"><code>201</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.2"
>RFC
2616, Section
10.2.2</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">ACCEPTED
</tt></td>
<td class=
"center"><code>202</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.3"
>RFC
2616, Section
10.2.3</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">NON_AUTHORITATIVE_INFORMATION
</tt></td>
<td class=
"center"><code>203</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.4"
>RFC
2616, Section
10.2.4</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">NO_CONTENT
</tt></td>
<td class=
"center"><code>204</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.5"
>RFC
2616, Section
10.2.5</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">RESET_CONTENT
</tt></td>
<td class=
"center"><code>205</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.6"
>RFC
2616, Section
10.2.6</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">PARTIAL_CONTENT
</tt></td>
<td class=
"center"><code>206</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.7"
>RFC
2616, Section
10.2.7</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">MULTI_STATUS
</tt></td>
<td class=
"center"><code>207</code></td>
<td class=
"left" >WEBDAV
<a class=
"ulink" href=
"http://www.webdav.org/specs/rfc2518.html#STATUS_207"
>RFC
2518, Section
10.2</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">IM_USED
</tt></td>
<td class=
"center"><code>226</code></td>
<td class=
"left" >Delta encoding in HTTP,
<a class=
"rfc" id='rfcref-
90088' xml:id='rfcref-
90088'
href=
"http://www.faqs.org/rfcs/rfc3229.html">RFC
3229</a>, Section
10.4.1</td></tr><P>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">MULTIPLE_CHOICES
</tt></td>
<td class=
"center"><code>300</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.1"
>RFC
2616, Section
10.3.1</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">MOVED_PERMANENTLY
</tt></td>
<td class=
"center"><code>301</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.2"
>RFC
2616, Section
10.3.2</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">FOUND
</tt></td>
<td class=
"center"><code>302</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.3"
>RFC
2616, Section
10.3.3</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">SEE_OTHER
</tt></td>
<td class=
"center"><code>303</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.4"
>RFC
2616, Section
10.3.4</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">NOT_MODIFIED
</tt></td>
<td class=
"center"><code>304</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5"
>RFC
2616, Section
10.3.5</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">USE_PROXY
</tt></td>
<td class=
"center"><code>305</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.6"
>RFC
2616, Section
10.3.6</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">TEMPORARY_REDIRECT
</tt></td>
<td class=
"center"><code>307</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.8"
>RFC
2616, Section
10.3.8</a></td></tr><P>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">BAD_REQUEST
</tt></td>
<td class=
"center"><code>400</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1"
>RFC
2616, Section
10.4.1</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">UNAUTHORIZED
</tt></td>
<td class=
"center"><code>401</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2"
>RFC
2616, Section
10.4.2</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">PAYMENT_REQUIRED
</tt></td>
<td class=
"center"><code>402</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.3"
>RFC
2616, Section
10.4.3</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">FORBIDDEN
</tt></td>
<td class=
"center"><code>403</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4"
>RFC
2616, Section
10.4.4</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">NOT_FOUND
</tt></td>
<td class=
"center"><code>404</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5"
>RFC
2616, Section
10.4.5</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">METHOD_NOT_ALLOWED
</tt></td>
<td class=
"center"><code>405</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.6"
>RFC
2616, Section
10.4.6</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">NOT_ACCEPTABLE
</tt></td>
<td class=
"center"><code>406</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.7"
>RFC
2616, Section
10.4.7</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">PROXY_AUTHENTICATION_REQUIRED
</tt></td>
<td class=
"center"><code>407</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.8"
>RFC
2616, Section
10.4.8</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">REQUEST_TIMEOUT
</tt></td>
<td class=
"center"><code>408</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.9"
>RFC
2616, Section
10.4.9</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">CONFLICT
</tt></td>
<td class=
"center"><code>409</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.10"
>RFC
2616, Section
10.4.10</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">GONE
</tt></td>
<td class=
"center"><code>410</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.11"
>RFC
2616, Section
10.4.11</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">LENGTH_REQUIRED
</tt></td>
<td class=
"center"><code>411</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.12"
>RFC
2616, Section
10.4.12</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">PRECONDITION_FAILED
</tt></td>
<td class=
"center"><code>412</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.13"
>RFC
2616, Section
10.4.13</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">REQUEST_ENTITY_TOO_LARGE
</tt></td>
<td class=
"center"><code>413</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.14"
>RFC
2616, Section
10.4.14</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">REQUEST_URI_TOO_LONG
</tt></td>
<td class=
"center"><code>414</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.15"
>RFC
2616, Section
10.4.15</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">UNSUPPORTED_MEDIA_TYPE
</tt></td>
<td class=
"center"><code>415</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.16"
>RFC
2616, Section
10.4.16</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">REQUESTED_RANGE_NOT_SATISFIABLE
</tt></td>
<td class=
"center"><code>416</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.17"
>RFC
2616, Section
10.4.17</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">EXPECTATION_FAILED
</tt></td>
<td class=
"center"><code>417</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.18"
>RFC
2616, Section
10.4.18</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">UNPROCESSABLE_ENTITY
</tt></td>
<td class=
"center"><code>422</code></td>
<td class=
"left" >WEBDAV,
<a class=
"ulink" href=
"http://www.webdav.org/specs/rfc2518.html#STATUS_422"
>RFC
2518, Section
10.3</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">LOCKED
</tt></td>
<td class=
"center"><code>423</code></td>
<td class=
"left" >WEBDAV
<a class=
"ulink" href=
"http://www.webdav.org/specs/rfc2518.html#STATUS_423"
>RFC
2518, Section
10.4</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">FAILED_DEPENDENCY
</tt></td>
<td class=
"center"><code>424</code></td>
<td class=
"left" >WEBDAV,
<a class=
"ulink" href=
"http://www.webdav.org/specs/rfc2518.html#STATUS_424"
>RFC
2518, Section
10.5</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">UPGRADE_REQUIRED
</tt></td>
<td class=
"center"><code>426</code></td>
<td class=
"left" >HTTP Upgrade to TLS,
<a class=
"rfc" id='rfcref-
90090' xml:id='rfcref-
90090'
href=
"http://www.faqs.org/rfcs/rfc2817.html">RFC
2817</a>, Section
6</td></tr><P>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">INTERNAL_SERVER_ERROR
</tt></td>
<td class=
"center"><code>500</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1"
>RFC
2616, Section
10.5.1</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">NOT_IMPLEMENTED
</tt></td>
<td class=
"center"><code>501</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.2"
>RFC
2616, Section
10.5.2</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">BAD_GATEWAY
</tt></td>
<td class=
"center"><code>502</code></td>
<td class=
"left" >HTTP/
1.1 <a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.3"
>RFC
2616, Section
10.5.3</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">SERVICE_UNAVAILABLE
</tt></td>
<td class=
"center"><code>503</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.4"
>RFC
2616, Section
10.5.4</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">GATEWAY_TIMEOUT
</tt></td>
<td class=
"center"><code>504</code></td>
<td class=
"left" >HTTP/
1.1 <a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.5"
>RFC
2616, Section
10.5.5</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">HTTP_VERSION_NOT_SUPPORTED
</tt></td>
<td class=
"center"><code>505</code></td>
<td class=
"left" >HTTP/
1.1,
<a class=
"ulink" href=
"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.6"
>RFC
2616, Section
10.5.6</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">INSUFFICIENT_STORAGE
</tt></td>
<td class=
"center"><code>507</code></td>
<td class=
"left" >WEBDAV,
<a class=
"ulink" href=
"http://www.webdav.org/specs/rfc2518.html#STATUS_507"
>RFC
2518, Section
10.6</a></td></tr>
<tr><td class=
"left" valign=
"baseline"><tt class=
"constant">NOT_EXTENDED
</tt></td>
<td class=
"center"><code>510</code></td>
<td class=
"left" >An HTTP Extension Framework,
<a class=
"rfc" id='rfcref-
90092' xml:id='rfcref-
90092'
href=
"http://www.faqs.org/rfcs/rfc2774.html">RFC
2774</a>, Section
7</td></tr></tbody>
<p><br /></p><hr class='online-navigation'
/>
<div class='online-navigation'
>
<!--Table of Child-Links-->
<A NAME=
"CHILD_LINKS"><STRONG>Subsections
</STRONG></a>
<LI><A href=
"httpconnection-objects.html">11.6.1 HTTPConnection Objects
</a>
<LI><A href=
"httpresponse-objects.html">11.6.2 HTTPResponse Objects
</a>
<LI><A href=
"httplib-examples.html">11.6.3 Examples
</a>
<!--End of Table of Child-Links-->
<div class='online-navigation'
>
<table align=
"center" width=
"100%" cellpadding=
"0" cellspacing=
"2">
<td class='online-navigation'
><a rel=
"prev" title=
"11.5.22 Examples"
href=
"urllib2-examples.html"><img src='../icons/previous.png'
border='
0' height='
32' alt='Previous Page' width='
32'
/></A></td>
<td class='online-navigation'
><a rel=
"parent" title=
"11. Internet Protocols and"
href=
"internet.html"><img src='../icons/up.png'
border='
0' height='
32' alt='Up One Level' width='
32'
/></A></td>
<td class='online-navigation'
><a rel=
"next" title=
"11.6.1 HTTPConnection Objects"
href=
"httpconnection-objects.html"><img src='../icons/next.png'
border='
0' height='
32' alt='Next Page' width='
32'
/></A></td>
<td align=
"center" width=
"100%">Python Library Reference
</td>
<td class='online-navigation'
><a rel=
"contents" title=
"Table of Contents"
href=
"contents.html"><img src='../icons/contents.png'
border='
0' height='
32' alt='Contents' width='
32'
/></A></td>
<td class='online-navigation'
><a href=
"modindex.html" title=
"Module Index"><img src='../icons/modules.png'
border='
0' height='
32' alt='Module Index' width='
32'
/></a></td>
<td class='online-navigation'
><a rel=
"index" title=
"Index"
href=
"genindex.html"><img src='../icons/index.png'
border='
0' height='
32' alt='Index' width='
32'
/></A></td>
<div class='online-navigation'
>
<b class=
"navlabel">Previous:
</b>
<a class=
"sectref" rel=
"prev" href=
"urllib2-examples.html">11.5.22 Examples
</A>
<b class=
"navlabel">Up:
</b>
<a class=
"sectref" rel=
"parent" href=
"internet.html">11. Internet Protocols and
</A>
<b class=
"navlabel">Next:
</b>
<a class=
"sectref" rel=
"next" href=
"httpconnection-objects.html">11.6.1 HTTPConnection Objects
</A>
<span class=
"release-info">Release
2.4.2, documentation updated on
28 September
2005.
</span>
<!--End of Navigation Panel-->
See
<i><a href=
"about.html">About this document...
</a></i> for information on suggesting changes.