Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
2 | <html> | |
3 | <head> | |
4 | <link rel="STYLESHEET" href="lib.css" type='text/css' /> | |
5 | <link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" /> | |
6 | <link rel='start' href='../index.html' title='Python Documentation Index' /> | |
7 | <link rel="first" href="lib.html" title='Python Library Reference' /> | |
8 | <link rel='contents' href='contents.html' title="Contents" /> | |
9 | <link rel='index' href='genindex.html' title='Index' /> | |
10 | <link rel='last' href='about.html' title='About this document...' /> | |
11 | <link rel='help' href='about.html' title='About this document...' /> | |
12 | <link rel="next" href="httplib-examples.html" /> | |
13 | <link rel="prev" href="httpconnection-objects.html" /> | |
14 | <link rel="parent" href="module-httplib.html" /> | |
15 | <link rel="next" href="httplib-examples.html" /> | |
16 | <meta name='aesop' content='information' /> | |
17 | <title>11.6.2 HTTPResponse Objects </title> | |
18 | </head> | |
19 | <body> | |
20 | <DIV CLASS="navigation"> | |
21 | <div id='top-navigation-panel' xml:id='top-navigation-panel'> | |
22 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> | |
23 | <tr> | |
24 | <td class='online-navigation'><a rel="prev" title="11.6.1 HTTPConnection Objects" | |
25 | href="httpconnection-objects.html"><img src='../icons/previous.png' | |
26 | border='0' height='32' alt='Previous Page' width='32' /></A></td> | |
27 | <td class='online-navigation'><a rel="parent" title="11.6 httplib " | |
28 | href="module-httplib.html"><img src='../icons/up.png' | |
29 | border='0' height='32' alt='Up One Level' width='32' /></A></td> | |
30 | <td class='online-navigation'><a rel="next" title="11.6.3 Examples" | |
31 | href="httplib-examples.html"><img src='../icons/next.png' | |
32 | border='0' height='32' alt='Next Page' width='32' /></A></td> | |
33 | <td align="center" width="100%">Python Library Reference</td> | |
34 | <td class='online-navigation'><a rel="contents" title="Table of Contents" | |
35 | href="contents.html"><img src='../icons/contents.png' | |
36 | border='0' height='32' alt='Contents' width='32' /></A></td> | |
37 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' | |
38 | border='0' height='32' alt='Module Index' width='32' /></a></td> | |
39 | <td class='online-navigation'><a rel="index" title="Index" | |
40 | href="genindex.html"><img src='../icons/index.png' | |
41 | border='0' height='32' alt='Index' width='32' /></A></td> | |
42 | </tr></table> | |
43 | <div class='online-navigation'> | |
44 | <b class="navlabel">Previous:</b> | |
45 | <a class="sectref" rel="prev" href="httpconnection-objects.html">11.6.1 HTTPConnection Objects</A> | |
46 | <b class="navlabel">Up:</b> | |
47 | <a class="sectref" rel="parent" href="module-httplib.html">11.6 httplib </A> | |
48 | <b class="navlabel">Next:</b> | |
49 | <a class="sectref" rel="next" href="httplib-examples.html">11.6.3 Examples</A> | |
50 | </div> | |
51 | <hr /></div> | |
52 | </DIV> | |
53 | <!--End of Navigation Panel--> | |
54 | ||
55 | <H2><A NAME="SECTION0013620000000000000000"></A><A NAME="httpresponse-objects"></A> | |
56 | <BR> | |
57 | 11.6.2 HTTPResponse Objects | |
58 | </H2> | |
59 | ||
60 | <P> | |
61 | <tt class="class">HTTPResponse</tt> instances have the following methods and attributes: | |
62 | ||
63 | <P> | |
64 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
65 | <td><nobr><b><tt id='l2h-3325' xml:id='l2h-3325' class="method">read</tt></b>(</nobr></td> | |
66 | <td><var></var><big>[</big><var>amt</var><big>]</big><var></var>)</td></tr></table></dt> | |
67 | <dd> | |
68 | Reads and returns the response body, or up to the next <var>amt</var> bytes. | |
69 | </dl> | |
70 | ||
71 | <P> | |
72 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
73 | <td><nobr><b><tt id='l2h-3326' xml:id='l2h-3326' class="method">getheader</tt></b>(</nobr></td> | |
74 | <td><var>name</var><big>[</big><var>, default</var><big>]</big><var></var>)</td></tr></table></dt> | |
75 | <dd> | |
76 | Get the contents of the header <var>name</var>, or <var>default</var> if there is no | |
77 | matching header. | |
78 | </dl> | |
79 | ||
80 | <P> | |
81 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
82 | <td><nobr><b><tt id='l2h-3327' xml:id='l2h-3327' class="method">getheaders</tt></b>(</nobr></td> | |
83 | <td><var></var>)</td></tr></table></dt> | |
84 | <dd> | |
85 | Return a list of (header, value) tuples. | |
86 | <span class="versionnote">New in version 2.4.</span> | |
87 | ||
88 | </dl> | |
89 | ||
90 | <P> | |
91 | <dl><dt><b><tt id='l2h-3328' xml:id='l2h-3328'>msg</tt></b></dt> | |
92 | <dd> | |
93 | A <tt class="class">mimetools.Message</tt> instance containing the response headers. | |
94 | </dd></dl> | |
95 | ||
96 | <P> | |
97 | <dl><dt><b><tt id='l2h-3329' xml:id='l2h-3329'>version</tt></b></dt> | |
98 | <dd> | |
99 | HTTP protocol version used by server. 10 for HTTP/1.0, 11 for HTTP/1.1. | |
100 | </dd></dl> | |
101 | ||
102 | <P> | |
103 | <dl><dt><b><tt id='l2h-3330' xml:id='l2h-3330'>status</tt></b></dt> | |
104 | <dd> | |
105 | Status code returned by server. | |
106 | </dd></dl> | |
107 | ||
108 | <P> | |
109 | <dl><dt><b><tt id='l2h-3331' xml:id='l2h-3331'>reason</tt></b></dt> | |
110 | <dd> | |
111 | Reason phrase returned by server. | |
112 | </dd></dl> | |
113 | ||
114 | <P> | |
115 | ||
116 | <DIV CLASS="navigation"> | |
117 | <div class='online-navigation'> | |
118 | <p></p><hr /> | |
119 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> | |
120 | <tr> | |
121 | <td class='online-navigation'><a rel="prev" title="11.6.1 HTTPConnection Objects" | |
122 | href="httpconnection-objects.html"><img src='../icons/previous.png' | |
123 | border='0' height='32' alt='Previous Page' width='32' /></A></td> | |
124 | <td class='online-navigation'><a rel="parent" title="11.6 httplib " | |
125 | href="module-httplib.html"><img src='../icons/up.png' | |
126 | border='0' height='32' alt='Up One Level' width='32' /></A></td> | |
127 | <td class='online-navigation'><a rel="next" title="11.6.3 Examples" | |
128 | href="httplib-examples.html"><img src='../icons/next.png' | |
129 | border='0' height='32' alt='Next Page' width='32' /></A></td> | |
130 | <td align="center" width="100%">Python Library Reference</td> | |
131 | <td class='online-navigation'><a rel="contents" title="Table of Contents" | |
132 | href="contents.html"><img src='../icons/contents.png' | |
133 | border='0' height='32' alt='Contents' width='32' /></A></td> | |
134 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' | |
135 | border='0' height='32' alt='Module Index' width='32' /></a></td> | |
136 | <td class='online-navigation'><a rel="index" title="Index" | |
137 | href="genindex.html"><img src='../icons/index.png' | |
138 | border='0' height='32' alt='Index' width='32' /></A></td> | |
139 | </tr></table> | |
140 | <div class='online-navigation'> | |
141 | <b class="navlabel">Previous:</b> | |
142 | <a class="sectref" rel="prev" href="httpconnection-objects.html">11.6.1 HTTPConnection Objects</A> | |
143 | <b class="navlabel">Up:</b> | |
144 | <a class="sectref" rel="parent" href="module-httplib.html">11.6 httplib </A> | |
145 | <b class="navlabel">Next:</b> | |
146 | <a class="sectref" rel="next" href="httplib-examples.html">11.6.3 Examples</A> | |
147 | </div> | |
148 | </div> | |
149 | <hr /> | |
150 | <span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span> | |
151 | </DIV> | |
152 | <!--End of Navigation Panel--> | |
153 | <ADDRESS> | |
154 | See <i><a href="about.html">About this document...</a></i> for information on suggesting changes. | |
155 | </ADDRESS> | |
156 | </BODY> | |
157 | </HTML> |