~dkuhlman/python-training-materials/Materials

« back to all changes in this revision

Viewing changes to python-3.5.1-docs-html/library/http.html

  • Committer: Dave Kuhlman
  • Date: 2017-04-15 16:24:56 UTC
  • Revision ID: dkuhlman@davekuhlman.org-20170415162456-iav9vozzg4iwqwv3
Updated docs

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
 
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
 
 
4
 
 
5
 
<html xmlns="http://www.w3.org/1999/xhtml">
6
 
  <head>
7
 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8
 
    
9
 
    <title>21.11. http — HTTP modules &mdash; Python 3.5.1 documentation</title>
10
 
    
11
 
    <link rel="stylesheet" href="../_static/pydoctheme.css" type="text/css" />
12
 
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
13
 
    
14
 
    <script type="text/javascript">
15
 
      var DOCUMENTATION_OPTIONS = {
16
 
        URL_ROOT:    '../',
17
 
        VERSION:     '3.5.1',
18
 
        COLLAPSE_INDEX: false,
19
 
        FILE_SUFFIX: '.html',
20
 
        HAS_SOURCE:  true
21
 
      };
22
 
    </script>
23
 
    <script type="text/javascript" src="../_static/jquery.js"></script>
24
 
    <script type="text/javascript" src="../_static/underscore.js"></script>
25
 
    <script type="text/javascript" src="../_static/doctools.js"></script>
26
 
    <script type="text/javascript" src="../_static/sidebar.js"></script>
27
 
    <link rel="search" type="application/opensearchdescription+xml"
28
 
          title="Search within Python 3.5.1 documentation"
29
 
          href="../_static/opensearch.xml"/>
30
 
    <link rel="author" title="About these documents" href="../about.html" />
31
 
    <link rel="copyright" title="Copyright" href="../copyright.html" />
32
 
    <link rel="top" title="Python 3.5.1 documentation" href="../contents.html" />
33
 
    <link rel="up" title="21. Internet Protocols and Support" href="internet.html" />
34
 
    <link rel="next" title="21.12. http.client — HTTP protocol client" href="http.client.html" />
35
 
    <link rel="prev" title="21.10. urllib.robotparser — Parser for robots.txt" href="urllib.robotparser.html" />
36
 
    <link rel="shortcut icon" type="image/png" href="../_static/py.png" />
37
 
    <script type="text/javascript" src="../_static/copybutton.js"></script>
38
 
    <script type="text/javascript" src="../_static/version_switch.js"></script>
39
 
    
40
 
 
41
 
 
42
 
  </head>
43
 
  <body role="document">  
44
 
    <div class="related" role="navigation" aria-label="related navigation">
45
 
      <h3>Navigation</h3>
46
 
      <ul>
47
 
        <li class="right" style="margin-right: 10px">
48
 
          <a href="../genindex.html" title="General Index"
49
 
             accesskey="I">index</a></li>
50
 
        <li class="right" >
51
 
          <a href="../py-modindex.html" title="Python Module Index"
52
 
             >modules</a> |</li>
53
 
        <li class="right" >
54
 
          <a href="http.client.html" title="21.12. http.client — HTTP protocol client"
55
 
             accesskey="N">next</a> |</li>
56
 
        <li class="right" >
57
 
          <a href="urllib.robotparser.html" title="21.10. urllib.robotparser — Parser for robots.txt"
58
 
             accesskey="P">previous</a> |</li>
59
 
        <li><img src="../_static/py.png" alt=""
60
 
                 style="vertical-align: middle; margin-top: -1px"/></li>
61
 
        <li><a href="https://www.python.org/">Python</a> &raquo;</li>
62
 
        <li>
63
 
          <span class="version_switcher_placeholder">3.5.1</span>
64
 
          <a href="../index.html">Documentation </a> &raquo;
65
 
        </li>
66
 
 
67
 
          <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> &raquo;</li>
68
 
          <li class="nav-item nav-item-2"><a href="internet.html" accesskey="U">21. Internet Protocols and Support</a> &raquo;</li> 
69
 
      </ul>
70
 
    </div>    
71
 
 
72
 
    <div class="document">
73
 
      <div class="documentwrapper">
74
 
        <div class="bodywrapper">
75
 
          <div class="body" role="main">
76
 
            
77
 
  <div class="section" id="module-http">
78
 
<span id="http-http-modules"></span><h1>21.11. <a class="reference internal" href="#module-http" title="http: HTTP status codes and messages"><code class="xref py py-mod docutils literal"><span class="pre">http</span></code></a> &#8212; HTTP modules<a class="headerlink" href="#module-http" title="Permalink to this headline">¶</a></h1>
79
 
<p id="index-0"><strong>Source code:</strong> <a class="reference external" href="https://hg.python.org/cpython/file/3.5/Lib/http/__init__.py">Lib/http/__init__.py</a></p>
80
 
<p><a class="reference internal" href="#module-http" title="http: HTTP status codes and messages"><code class="xref py py-mod docutils literal"><span class="pre">http</span></code></a> is a package that collects several modules for working with the
81
 
HyperText Transfer Protocol:</p>
82
 
<ul class="simple">
83
 
<li><a class="reference internal" href="http.client.html#module-http.client" title="http.client: HTTP and HTTPS protocol client (requires sockets)."><code class="xref py py-mod docutils literal"><span class="pre">http.client</span></code></a> is a low-level HTTP protocol client; for high-level URL
84
 
opening use <a class="reference internal" href="urllib.request.html#module-urllib.request" title="urllib.request: Extensible library for opening URLs."><code class="xref py py-mod docutils literal"><span class="pre">urllib.request</span></code></a></li>
85
 
<li><a class="reference internal" href="http.server.html#module-http.server" title="http.server: HTTP server and request handlers."><code class="xref py py-mod docutils literal"><span class="pre">http.server</span></code></a> contains basic HTTP server classes based on <a class="reference internal" href="socketserver.html#module-socketserver" title="socketserver: A framework for network servers."><code class="xref py py-mod docutils literal"><span class="pre">socketserver</span></code></a></li>
86
 
<li><a class="reference internal" href="http.cookies.html#module-http.cookies" title="http.cookies: Support for HTTP state management (cookies)."><code class="xref py py-mod docutils literal"><span class="pre">http.cookies</span></code></a> has utilities for implementing state management with cookies</li>
87
 
<li><a class="reference internal" href="http.cookiejar.html#module-http.cookiejar" title="http.cookiejar: Classes for automatic handling of HTTP cookies."><code class="xref py py-mod docutils literal"><span class="pre">http.cookiejar</span></code></a> provides persistence of cookies</li>
88
 
</ul>
89
 
<p><a class="reference internal" href="#module-http" title="http: HTTP status codes and messages"><code class="xref py py-mod docutils literal"><span class="pre">http</span></code></a> is also a module that defines a number of HTTP status codes and
90
 
associated messages through the <a class="reference internal" href="#http.HTTPStatus" title="http.HTTPStatus"><code class="xref py py-class docutils literal"><span class="pre">http.HTTPStatus</span></code></a> enum:</p>
91
 
<dl class="class">
92
 
<dt id="http.HTTPStatus">
93
 
<em class="property">class </em><code class="descclassname">http.</code><code class="descname">HTTPStatus</code><a class="headerlink" href="#http.HTTPStatus" title="Permalink to this definition">¶</a></dt>
94
 
<dd><div class="versionadded">
95
 
<p><span class="versionmodified">New in version 3.5.</span></p>
96
 
</div>
97
 
<p>A subclass of <a class="reference internal" href="enum.html#enum.IntEnum" title="enum.IntEnum"><code class="xref py py-class docutils literal"><span class="pre">enum.IntEnum</span></code></a> that defines a set of HTTP status codes,
98
 
reason phrases and long descriptions written in English.</p>
99
 
<p>Usage:</p>
100
 
<div class="highlight-python3"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">http</span> <span class="k">import</span> <span class="n">HTTPStatus</span>
101
 
<span class="gp">&gt;&gt;&gt; </span><span class="n">HTTPStatus</span><span class="o">.</span><span class="n">OK</span>
102
 
<span class="go">&lt;HTTPStatus.OK: 200&gt;</span>
103
 
<span class="gp">&gt;&gt;&gt; </span><span class="n">HTTPStatus</span><span class="o">.</span><span class="n">OK</span> <span class="o">==</span> <span class="mi">200</span>
104
 
<span class="go">True</span>
105
 
<span class="gp">&gt;&gt;&gt; </span><span class="n">http</span><span class="o">.</span><span class="n">HTTPStatus</span><span class="o">.</span><span class="n">OK</span><span class="o">.</span><span class="n">value</span>
106
 
<span class="go">200</span>
107
 
<span class="gp">&gt;&gt;&gt; </span><span class="n">HTTPStatus</span><span class="o">.</span><span class="n">OK</span><span class="o">.</span><span class="n">phrase</span>
108
 
<span class="go">&#39;OK&#39;</span>
109
 
<span class="gp">&gt;&gt;&gt; </span><span class="n">HTTPStatus</span><span class="o">.</span><span class="n">OK</span><span class="o">.</span><span class="n">description</span>
110
 
<span class="go">&#39;Request fulfilled, document follows&#39;</span>
111
 
<span class="gp">&gt;&gt;&gt; </span><span class="nb">list</span><span class="p">(</span><span class="n">HTTPStatus</span><span class="p">)</span>
112
 
<span class="go">[&lt;HTTPStatus.CONTINUE: 100&gt;, &lt;HTTPStatus.SWITCHING_PROTOCOLS: 101&gt;, ...]</span>
113
 
</pre></div>
114
 
</div>
115
 
</dd></dl>
116
 
 
117
 
<div class="section" id="http-status-codes">
118
 
<span id="id1"></span><h2>21.11.1. HTTP status codes<a class="headerlink" href="#http-status-codes" title="Permalink to this headline">¶</a></h2>
119
 
<p>Supported,
120
 
<a class="reference external" href="http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml">IANA-registered</a>
121
 
status codes available in <a class="reference internal" href="#http.HTTPStatus" title="http.HTTPStatus"><code class="xref py py-class docutils literal"><span class="pre">http.HTTPStatus</span></code></a> are:</p>
122
 
<table border="1" class="docutils">
123
 
<colgroup>
124
 
<col width="6%" />
125
 
<col width="29%" />
126
 
<col width="65%" />
127
 
</colgroup>
128
 
<thead valign="bottom">
129
 
<tr class="row-odd"><th class="head">Code</th>
130
 
<th class="head">Enum Name</th>
131
 
<th class="head">Details</th>
132
 
</tr>
133
 
</thead>
134
 
<tbody valign="top">
135
 
<tr class="row-even"><td><code class="docutils literal"><span class="pre">100</span></code></td>
136
 
<td><code class="docutils literal"><span class="pre">CONTINUE</span></code></td>
137
 
<td>HTTP/1.1 <span class="target" id="index-1"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7231.html"><strong>RFC 7231</strong></a>, Section 6.2.1</td>
138
 
</tr>
139
 
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">101</span></code></td>
140
 
<td><code class="docutils literal"><span class="pre">SWITCHING_PROTOCOLS</span></code></td>
141
 
<td>HTTP/1.1 <span class="target" id="index-2"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7231.html"><strong>RFC 7231</strong></a>, Section 6.2.2</td>
142
 
</tr>
143
 
<tr class="row-even"><td><code class="docutils literal"><span class="pre">102</span></code></td>
144
 
<td><code class="docutils literal"><span class="pre">PROCESSING</span></code></td>
145
 
<td>WebDAV <span class="target" id="index-3"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc2518.html"><strong>RFC 2518</strong></a>, Section 10.1</td>
146
 
</tr>
147
 
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">200</span></code></td>
148
 
<td><code class="docutils literal"><span class="pre">OK</span></code></td>
149
 
<td>HTTP/1.1 <span class="target" id="index-4"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7231.html"><strong>RFC 7231</strong></a>, Section 6.3.1</td>
150
 
</tr>
151
 
<tr class="row-even"><td><code class="docutils literal"><span class="pre">201</span></code></td>
152
 
<td><code class="docutils literal"><span class="pre">CREATED</span></code></td>
153
 
<td>HTTP/1.1 <span class="target" id="index-5"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7231.html"><strong>RFC 7231</strong></a>, Section 6.3.2</td>
154
 
</tr>
155
 
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">202</span></code></td>
156
 
<td><code class="docutils literal"><span class="pre">ACCEPTED</span></code></td>
157
 
<td>HTTP/1.1 <span class="target" id="index-6"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7231.html"><strong>RFC 7231</strong></a>, Section 6.3.3</td>
158
 
</tr>
159
 
<tr class="row-even"><td><code class="docutils literal"><span class="pre">203</span></code></td>
160
 
<td><code class="docutils literal"><span class="pre">NON_AUTHORITATIVE_INFORMATION</span></code></td>
161
 
<td>HTTP/1.1 <span class="target" id="index-7"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7231.html"><strong>RFC 7231</strong></a>, Section 6.3.4</td>
162
 
</tr>
163
 
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">204</span></code></td>
164
 
<td><code class="docutils literal"><span class="pre">NO_CONTENT</span></code></td>
165
 
<td>HTTP/1.1 <span class="target" id="index-8"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7231.html"><strong>RFC 7231</strong></a>, Section 6.3.5</td>
166
 
</tr>
167
 
<tr class="row-even"><td><code class="docutils literal"><span class="pre">205</span></code></td>
168
 
<td><code class="docutils literal"><span class="pre">RESET_CONTENT</span></code></td>
169
 
<td>HTTP/1.1 <span class="target" id="index-9"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7231.html"><strong>RFC 7231</strong></a>, Section 6.3.6</td>
170
 
</tr>
171
 
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">206</span></code></td>
172
 
<td><code class="docutils literal"><span class="pre">PARTIAL_CONTENT</span></code></td>
173
 
<td>HTTP/1.1 <span class="target" id="index-10"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7233.html"><strong>RFC 7233</strong></a>, Section 4.1</td>
174
 
</tr>
175
 
<tr class="row-even"><td><code class="docutils literal"><span class="pre">207</span></code></td>
176
 
<td><code class="docutils literal"><span class="pre">MULTI_STATUS</span></code></td>
177
 
<td>WebDAV <span class="target" id="index-11"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc4918.html"><strong>RFC 4918</strong></a>, Section 11.1</td>
178
 
</tr>
179
 
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">208</span></code></td>
180
 
<td><code class="docutils literal"><span class="pre">ALREADY_REPORTED</span></code></td>
181
 
<td>WebDAV Binding Extensions <span class="target" id="index-12"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc5842.html"><strong>RFC 5842</strong></a>, Section 7.1 (Experimental)</td>
182
 
</tr>
183
 
<tr class="row-even"><td><code class="docutils literal"><span class="pre">226</span></code></td>
184
 
<td><code class="docutils literal"><span class="pre">IM_USED</span></code></td>
185
 
<td>Delta Encoding in HTTP <span class="target" id="index-13"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc3229.html"><strong>RFC 3229</strong></a>, Section 10.4.1</td>
186
 
</tr>
187
 
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">300</span></code></td>
188
 
<td><code class="docutils literal"><span class="pre">MULTIPLE_CHOICES</span></code></td>
189
 
<td>HTTP/1.1 <span class="target" id="index-14"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7231.html"><strong>RFC 7231</strong></a>, Section 6.4.1</td>
190
 
</tr>
191
 
<tr class="row-even"><td><code class="docutils literal"><span class="pre">301</span></code></td>
192
 
<td><code class="docutils literal"><span class="pre">MOVED_PERMANENTLY</span></code></td>
193
 
<td>HTTP/1.1 <span class="target" id="index-15"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7231.html"><strong>RFC 7231</strong></a>, Section 6.4.2</td>
194
 
</tr>
195
 
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">302</span></code></td>
196
 
<td><code class="docutils literal"><span class="pre">FOUND</span></code></td>
197
 
<td>HTTP/1.1 <span class="target" id="index-16"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7231.html"><strong>RFC 7231</strong></a>, Section 6.4.3</td>
198
 
</tr>
199
 
<tr class="row-even"><td><code class="docutils literal"><span class="pre">303</span></code></td>
200
 
<td><code class="docutils literal"><span class="pre">SEE_OTHER</span></code></td>
201
 
<td>HTTP/1.1 <span class="target" id="index-17"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7231.html"><strong>RFC 7231</strong></a>, Section 6.4.4</td>
202
 
</tr>
203
 
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">304</span></code></td>
204
 
<td><code class="docutils literal"><span class="pre">NOT_MODIFIED</span></code></td>
205
 
<td>HTTP/1.1 <span class="target" id="index-18"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7232.html"><strong>RFC 7232</strong></a>, Section 4.1</td>
206
 
</tr>
207
 
<tr class="row-even"><td><code class="docutils literal"><span class="pre">305</span></code></td>
208
 
<td><code class="docutils literal"><span class="pre">USE_PROXY</span></code></td>
209
 
<td>HTTP/1.1 <span class="target" id="index-19"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7231.html"><strong>RFC 7231</strong></a>, Section 6.4.5</td>
210
 
</tr>
211
 
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">307</span></code></td>
212
 
<td><code class="docutils literal"><span class="pre">TEMPORARY_REDIRECT</span></code></td>
213
 
<td>HTTP/1.1 <span class="target" id="index-20"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7231.html"><strong>RFC 7231</strong></a>, Section 6.4.7</td>
214
 
</tr>
215
 
<tr class="row-even"><td><code class="docutils literal"><span class="pre">308</span></code></td>
216
 
<td><code class="docutils literal"><span class="pre">PERMANENT_REDIRECT</span></code></td>
217
 
<td>Permanent Redirect <span class="target" id="index-21"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7238.html"><strong>RFC 7238</strong></a>, Section 3 (Experimental)</td>
218
 
</tr>
219
 
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">400</span></code></td>
220
 
<td><code class="docutils literal"><span class="pre">BAD_REQUEST</span></code></td>
221
 
<td>HTTP/1.1 <span class="target" id="index-22"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7231.html"><strong>RFC 7231</strong></a>, Section 6.5.1</td>
222
 
</tr>
223
 
<tr class="row-even"><td><code class="docutils literal"><span class="pre">401</span></code></td>
224
 
<td><code class="docutils literal"><span class="pre">UNAUTHORIZED</span></code></td>
225
 
<td>HTTP/1.1 Authentication <span class="target" id="index-23"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7235.html"><strong>RFC 7235</strong></a>, Section 3.1</td>
226
 
</tr>
227
 
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">402</span></code></td>
228
 
<td><code class="docutils literal"><span class="pre">PAYMENT_REQUIRED</span></code></td>
229
 
<td>HTTP/1.1 <span class="target" id="index-24"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7231.html"><strong>RFC 7231</strong></a>, Section 6.5.2</td>
230
 
</tr>
231
 
<tr class="row-even"><td><code class="docutils literal"><span class="pre">403</span></code></td>
232
 
<td><code class="docutils literal"><span class="pre">FORBIDDEN</span></code></td>
233
 
<td>HTTP/1.1 <span class="target" id="index-25"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7231.html"><strong>RFC 7231</strong></a>, Section 6.5.3</td>
234
 
</tr>
235
 
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">404</span></code></td>
236
 
<td><code class="docutils literal"><span class="pre">NOT_FOUND</span></code></td>
237
 
<td>HTTP/1.1 <span class="target" id="index-26"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7231.html"><strong>RFC 7231</strong></a>, Section 6.5.4</td>
238
 
</tr>
239
 
<tr class="row-even"><td><code class="docutils literal"><span class="pre">405</span></code></td>
240
 
<td><code class="docutils literal"><span class="pre">METHOD_NOT_ALLOWED</span></code></td>
241
 
<td>HTTP/1.1 <span class="target" id="index-27"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7231.html"><strong>RFC 7231</strong></a>, Section 6.5.5</td>
242
 
</tr>
243
 
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">406</span></code></td>
244
 
<td><code class="docutils literal"><span class="pre">NOT_ACCEPTABLE</span></code></td>
245
 
<td>HTTP/1.1 <span class="target" id="index-28"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7231.html"><strong>RFC 7231</strong></a>, Section 6.5.6</td>
246
 
</tr>
247
 
<tr class="row-even"><td><code class="docutils literal"><span class="pre">407</span></code></td>
248
 
<td><code class="docutils literal"><span class="pre">PROXY_AUTHENTICATION_REQUIRED</span></code></td>
249
 
<td>HTTP/1.1 Authentication <span class="target" id="index-29"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7235.html"><strong>RFC 7235</strong></a>, Section 3.2</td>
250
 
</tr>
251
 
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">408</span></code></td>
252
 
<td><code class="docutils literal"><span class="pre">REQUEST_TIMEOUT</span></code></td>
253
 
<td>HTTP/1.1 <span class="target" id="index-30"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7231.html"><strong>RFC 7231</strong></a>, Section 6.5.7</td>
254
 
</tr>
255
 
<tr class="row-even"><td><code class="docutils literal"><span class="pre">409</span></code></td>
256
 
<td><code class="docutils literal"><span class="pre">CONFLICT</span></code></td>
257
 
<td>HTTP/1.1 <span class="target" id="index-31"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7231.html"><strong>RFC 7231</strong></a>, Section 6.5.8</td>
258
 
</tr>
259
 
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">410</span></code></td>
260
 
<td><code class="docutils literal"><span class="pre">GONE</span></code></td>
261
 
<td>HTTP/1.1 <span class="target" id="index-32"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7231.html"><strong>RFC 7231</strong></a>, Section 6.5.9</td>
262
 
</tr>
263
 
<tr class="row-even"><td><code class="docutils literal"><span class="pre">411</span></code></td>
264
 
<td><code class="docutils literal"><span class="pre">LENGTH_REQUIRED</span></code></td>
265
 
<td>HTTP/1.1 <span class="target" id="index-33"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7231.html"><strong>RFC 7231</strong></a>, Section 6.5.10</td>
266
 
</tr>
267
 
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">412</span></code></td>
268
 
<td><code class="docutils literal"><span class="pre">PRECONDITION_FAILED</span></code></td>
269
 
<td>HTTP/1.1 <span class="target" id="index-34"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7232.html"><strong>RFC 7232</strong></a>, Section 4.2</td>
270
 
</tr>
271
 
<tr class="row-even"><td><code class="docutils literal"><span class="pre">413</span></code></td>
272
 
<td><code class="docutils literal"><span class="pre">REQUEST_ENTITY_TOO_LARGE</span></code></td>
273
 
<td>HTTP/1.1 <span class="target" id="index-35"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7231.html"><strong>RFC 7231</strong></a>, Section 6.5.11</td>
274
 
</tr>
275
 
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">414</span></code></td>
276
 
<td><code class="docutils literal"><span class="pre">REQUEST_URI_TOO_LONG</span></code></td>
277
 
<td>HTTP/1.1 <span class="target" id="index-36"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7231.html"><strong>RFC 7231</strong></a>, Section 6.5.12</td>
278
 
</tr>
279
 
<tr class="row-even"><td><code class="docutils literal"><span class="pre">415</span></code></td>
280
 
<td><code class="docutils literal"><span class="pre">UNSUPPORTED_MEDIA_TYPE</span></code></td>
281
 
<td>HTTP/1.1 <span class="target" id="index-37"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7231.html"><strong>RFC 7231</strong></a>, Section 6.5.13</td>
282
 
</tr>
283
 
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">416</span></code></td>
284
 
<td><code class="docutils literal"><span class="pre">REQUEST_RANGE_NOT_SATISFIABLE</span></code></td>
285
 
<td>HTTP/1.1 Range Requests <span class="target" id="index-38"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7233.html"><strong>RFC 7233</strong></a>, Section 4.4</td>
286
 
</tr>
287
 
<tr class="row-even"><td><code class="docutils literal"><span class="pre">417</span></code></td>
288
 
<td><code class="docutils literal"><span class="pre">EXPECTATION_FAILED</span></code></td>
289
 
<td>HTTP/1.1 <span class="target" id="index-39"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7231.html"><strong>RFC 7231</strong></a>, Section 6.5.14</td>
290
 
</tr>
291
 
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">422</span></code></td>
292
 
<td><code class="docutils literal"><span class="pre">UNPROCESSABLE_ENTITY</span></code></td>
293
 
<td>WebDAV <span class="target" id="index-40"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc4918.html"><strong>RFC 4918</strong></a>, Section 11.2</td>
294
 
</tr>
295
 
<tr class="row-even"><td><code class="docutils literal"><span class="pre">423</span></code></td>
296
 
<td><code class="docutils literal"><span class="pre">LOCKED</span></code></td>
297
 
<td>WebDAV <span class="target" id="index-41"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc4918.html"><strong>RFC 4918</strong></a>, Section 11.3</td>
298
 
</tr>
299
 
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">424</span></code></td>
300
 
<td><code class="docutils literal"><span class="pre">FAILED_DEPENDENCY</span></code></td>
301
 
<td>WebDAV <span class="target" id="index-42"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc4918.html"><strong>RFC 4918</strong></a>, Section 11.4</td>
302
 
</tr>
303
 
<tr class="row-even"><td><code class="docutils literal"><span class="pre">426</span></code></td>
304
 
<td><code class="docutils literal"><span class="pre">UPGRADE_REQUIRED</span></code></td>
305
 
<td>HTTP/1.1 <span class="target" id="index-43"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7231.html"><strong>RFC 7231</strong></a>, Section 6.5.15</td>
306
 
</tr>
307
 
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">428</span></code></td>
308
 
<td><code class="docutils literal"><span class="pre">PRECONDITION_REQUIRED</span></code></td>
309
 
<td>Additional HTTP Status Codes <span class="target" id="index-44"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc6585.html"><strong>RFC 6585</strong></a></td>
310
 
</tr>
311
 
<tr class="row-even"><td><code class="docutils literal"><span class="pre">429</span></code></td>
312
 
<td><code class="docutils literal"><span class="pre">TOO_MANY_REQUESTS</span></code></td>
313
 
<td>Additional HTTP Status Codes <span class="target" id="index-45"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc6585.html"><strong>RFC 6585</strong></a></td>
314
 
</tr>
315
 
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">431</span></code></td>
316
 
<td><code class="docutils literal"><span class="pre">REQUEST_HEADER_FIELDS_TOO_LARGE</span></code></td>
317
 
<td>Additional HTTP Status Codes <span class="target" id="index-46"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc6585.html"><strong>RFC 6585</strong></a></td>
318
 
</tr>
319
 
<tr class="row-even"><td><code class="docutils literal"><span class="pre">500</span></code></td>
320
 
<td><code class="docutils literal"><span class="pre">INTERNAL_SERVER_ERROR</span></code></td>
321
 
<td>HTTP/1.1 <span class="target" id="index-47"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7231.html"><strong>RFC 7231</strong></a>, Section 6.6.1</td>
322
 
</tr>
323
 
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">501</span></code></td>
324
 
<td><code class="docutils literal"><span class="pre">NOT_IMPLEMENTED</span></code></td>
325
 
<td>HTTP/1.1 <span class="target" id="index-48"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7231.html"><strong>RFC 7231</strong></a>, Section 6.6.2</td>
326
 
</tr>
327
 
<tr class="row-even"><td><code class="docutils literal"><span class="pre">502</span></code></td>
328
 
<td><code class="docutils literal"><span class="pre">BAD_GATEWAY</span></code></td>
329
 
<td>HTTP/1.1 <span class="target" id="index-49"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7231.html"><strong>RFC 7231</strong></a>, Section 6.6.3</td>
330
 
</tr>
331
 
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">503</span></code></td>
332
 
<td><code class="docutils literal"><span class="pre">SERVICE_UNAVAILABLE</span></code></td>
333
 
<td>HTTP/1.1 <span class="target" id="index-50"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7231.html"><strong>RFC 7231</strong></a>, Section 6.6.4</td>
334
 
</tr>
335
 
<tr class="row-even"><td><code class="docutils literal"><span class="pre">504</span></code></td>
336
 
<td><code class="docutils literal"><span class="pre">GATEWAY_TIMEOUT</span></code></td>
337
 
<td>HTTP/1.1 <span class="target" id="index-51"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7231.html"><strong>RFC 7231</strong></a>, Section 6.6.5</td>
338
 
</tr>
339
 
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">505</span></code></td>
340
 
<td><code class="docutils literal"><span class="pre">HTTP_VERSION_NOT_SUPPORTED</span></code></td>
341
 
<td>HTTP/1.1 <span class="target" id="index-52"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc7231.html"><strong>RFC 7231</strong></a>, Section 6.6.6</td>
342
 
</tr>
343
 
<tr class="row-even"><td><code class="docutils literal"><span class="pre">506</span></code></td>
344
 
<td><code class="docutils literal"><span class="pre">VARIANT_ALSO_NEGOTIATES</span></code></td>
345
 
<td>Transparent Content Negotiation in HTTP <span class="target" id="index-53"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc2295.html"><strong>RFC 2295</strong></a>, Section 8.1 (Experimental)</td>
346
 
</tr>
347
 
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">507</span></code></td>
348
 
<td><code class="docutils literal"><span class="pre">INSUFFICIENT_STORAGE</span></code></td>
349
 
<td>WebDAV <span class="target" id="index-54"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc4918.html"><strong>RFC 4918</strong></a>, Section 11.5</td>
350
 
</tr>
351
 
<tr class="row-even"><td><code class="docutils literal"><span class="pre">508</span></code></td>
352
 
<td><code class="docutils literal"><span class="pre">LOOP_DETECTED</span></code></td>
353
 
<td>WebDAV Binding Extensions <span class="target" id="index-55"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc5842.html"><strong>RFC 5842</strong></a>, Section 7.2 (Experimental)</td>
354
 
</tr>
355
 
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">510</span></code></td>
356
 
<td><code class="docutils literal"><span class="pre">NOT_EXTENDED</span></code></td>
357
 
<td>An HTTP Extension Framework <span class="target" id="index-56"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc2774.html"><strong>RFC 2774</strong></a>, Section 7 (Experimental)</td>
358
 
</tr>
359
 
<tr class="row-even"><td><code class="docutils literal"><span class="pre">511</span></code></td>
360
 
<td><code class="docutils literal"><span class="pre">NETWORK_AUTHENTICATION_REQUIRED</span></code></td>
361
 
<td>Additional HTTP Status Codes <span class="target" id="index-57"></span><a class="rfc reference external" href="https://tools.ietf.org/html/rfc6585.html"><strong>RFC 6585</strong></a>, Section 6</td>
362
 
</tr>
363
 
</tbody>
364
 
</table>
365
 
<p>In order to preserve backwards compatibility, enum values are also present
366
 
in the <a class="reference internal" href="http.client.html#module-http.client" title="http.client: HTTP and HTTPS protocol client (requires sockets)."><code class="xref py py-mod docutils literal"><span class="pre">http.client</span></code></a> module in the form of constants. The enum name is
367
 
equal to the constant name (i.e. <code class="docutils literal"><span class="pre">http.HTTPStatus.OK</span></code> is also available as
368
 
<code class="docutils literal"><span class="pre">http.client.OK</span></code>).</p>
369
 
</div>
370
 
</div>
371
 
 
372
 
 
373
 
          </div>
374
 
        </div>
375
 
      </div>
376
 
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
377
 
        <div class="sphinxsidebarwrapper">
378
 
  <h3><a href="../contents.html">Table Of Contents</a></h3>
379
 
  <ul>
380
 
<li><a class="reference internal" href="#">21.11. <code class="docutils literal"><span class="pre">http</span></code> &#8212; HTTP modules</a><ul>
381
 
<li><a class="reference internal" href="#http-status-codes">21.11.1. HTTP status codes</a></li>
382
 
</ul>
383
 
</li>
384
 
</ul>
385
 
 
386
 
  <h4>Previous topic</h4>
387
 
  <p class="topless"><a href="urllib.robotparser.html"
388
 
                        title="previous chapter">21.10. <code class="docutils literal"><span class="pre">urllib.robotparser</span></code> &#8212;  Parser for robots.txt</a></p>
389
 
  <h4>Next topic</h4>
390
 
  <p class="topless"><a href="http.client.html"
391
 
                        title="next chapter">21.12. <code class="docutils literal"><span class="pre">http.client</span></code> &#8212; HTTP protocol client</a></p>
392
 
<h3>This Page</h3>
393
 
<ul class="this-page-menu">
394
 
  <li><a href="../bugs.html">Report a Bug</a></li>
395
 
  <li><a href="../_sources/library/http.txt"
396
 
         rel="nofollow">Show Source</a></li>
397
 
</ul>
398
 
 
399
 
<div id="searchbox" style="display: none" role="search">
400
 
  <h3>Quick search</h3>
401
 
    <form class="search" action="../search.html" method="get">
402
 
      <input type="text" name="q" />
403
 
      <input type="submit" value="Go" />
404
 
      <input type="hidden" name="check_keywords" value="yes" />
405
 
      <input type="hidden" name="area" value="default" />
406
 
    </form>
407
 
    <p class="searchtip" style="font-size: 90%">
408
 
    Enter search terms or a module, class or function name.
409
 
    </p>
410
 
</div>
411
 
<script type="text/javascript">$('#searchbox').show(0);</script>
412
 
        </div>
413
 
      </div>
414
 
      <div class="clearer"></div>
415
 
    </div>  
416
 
    <div class="related" role="navigation" aria-label="related navigation">
417
 
      <h3>Navigation</h3>
418
 
      <ul>
419
 
        <li class="right" style="margin-right: 10px">
420
 
          <a href="../genindex.html" title="General Index"
421
 
             >index</a></li>
422
 
        <li class="right" >
423
 
          <a href="../py-modindex.html" title="Python Module Index"
424
 
             >modules</a> |</li>
425
 
        <li class="right" >
426
 
          <a href="http.client.html" title="21.12. http.client — HTTP protocol client"
427
 
             >next</a> |</li>
428
 
        <li class="right" >
429
 
          <a href="urllib.robotparser.html" title="21.10. urllib.robotparser — Parser for robots.txt"
430
 
             >previous</a> |</li>
431
 
        <li><img src="../_static/py.png" alt=""
432
 
                 style="vertical-align: middle; margin-top: -1px"/></li>
433
 
        <li><a href="https://www.python.org/">Python</a> &raquo;</li>
434
 
        <li>
435
 
          <span class="version_switcher_placeholder">3.5.1</span>
436
 
          <a href="../index.html">Documentation </a> &raquo;
437
 
        </li>
438
 
 
439
 
          <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> &raquo;</li>
440
 
          <li class="nav-item nav-item-2"><a href="internet.html" >21. Internet Protocols and Support</a> &raquo;</li> 
441
 
      </ul>
442
 
    </div>  
443
 
    <div class="footer">
444
 
    &copy; <a href="../copyright.html">Copyright</a> 1990-2016, Python Software Foundation.
445
 
    <br />
446
 
    The Python Software Foundation is a non-profit corporation.
447
 
    <a href="https://www.python.org/psf/donations/">Please donate.</a>
448
 
    <br />
449
 
    Last updated on Jan 22, 2016.
450
 
    <a href="../bugs.html">Found a bug</a>?
451
 
    <br />
452
 
    Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.3.3.
453
 
    </div>
454
 
 
455
 
  </body>
456
 
</html>
 
 
b'\\ No newline at end of file'