|
21 | 21 | <font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr> |
22 | 22 |
|
23 | 23 | <tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td> |
24 | | -<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="httplib2.html">httplib2</a><br> |
| 24 | +<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="StringIO.html">StringIO</a><br> |
| 25 | +<a href="copy.html">copy</a><br> |
| 26 | +<a href="gzip.html">gzip</a><br> |
| 27 | +</td><td width="25%" valign=top><a href="httplib2.html">httplib2</a><br> |
| 28 | +<a href="apiclient.mimeparse.html">apiclient.mimeparse</a><br> |
| 29 | +<a href="mimetypes.html">mimetypes</a><br> |
25 | 30 | </td><td width="25%" valign=top><a href="os.html">os</a><br> |
26 | | -</td><td width="25%" valign=top><a href="django.utils.simplejson.html">django.utils.simplejson</a><br> |
27 | | -</td><td width="25%" valign=top></td></tr></table></td></tr></table><p> |
| 31 | +<a href="simplejson.html">simplejson</a><br> |
| 32 | +<a href="urllib.html">urllib</a><br> |
| 33 | +</td><td width="25%" valign=top><a href="urlparse.html">urlparse</a><br> |
| 34 | +<a href="uuid.html">uuid</a><br> |
| 35 | +</td></tr></table></td></tr></table><p> |
28 | 36 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
29 | 37 | <tr bgcolor="#ee77aa"> |
30 | 38 | <td colspan=3 valign=bottom> <br> |
|
50 | 58 | <td colspan=2><tt>Encapsulates a single HTTP request.<br> </tt></td></tr> |
51 | 59 | <tr><td> </td> |
52 | 60 | <td width="100%">Methods defined here:<br> |
53 | | -<dl><dt><a name="HttpRequest-__init__"><strong>__init__</strong></a>(self, http, postproc, uri, method<font color="#909090">='GET'</font>, body<font color="#909090">=None</font>, headers<font color="#909090">=None</font>, methodId<font color="#909090">=None</font>)</dt><dd><tt>Constructor for an <a href="#HttpRequest">HttpRequest</a>.<br> |
| 61 | +<dl><dt><a name="HttpRequest-__init__"><strong>__init__</strong></a>(self, http, postproc, uri, method<font color="#909090">='GET'</font>, body<font color="#909090">=None</font>, headers<font color="#909090">=None</font>, methodId<font color="#909090">=None</font>, resumable<font color="#909090">=None</font>)</dt><dd><tt>Constructor for an <a href="#HttpRequest">HttpRequest</a>.<br> |
54 | 62 | <br> |
55 | 63 | Args:<br> |
56 | 64 | http: httplib2.Http, the transport <a href="__builtin__.html#object">object</a> to use to make a request<br> |
|
59 | 67 | on an error.<br> |
60 | 68 | uri: string, the absolute URI to send the request to<br> |
61 | 69 | method: string, the HTTP method to use<br> |
62 | | - body: string, the request body of the HTTP request<br> |
| 70 | + body: string, the request body of the HTTP request,<br> |
63 | 71 | headers: dict, the HTTP request headers<br> |
64 | | - methodId: string, a unique identifier for the API method being called.</tt></dd></dl> |
| 72 | + methodId: string, a unique identifier for the API method being called.<br> |
| 73 | + resumable: MediaUpload, None if this is not a resumbale request.</tt></dd></dl> |
65 | 74 |
|
66 | 75 | <dl><dt><a name="HttpRequest-execute"><strong>execute</strong></a>(self, http<font color="#909090">=None</font>)</dt><dd><tt>Execute the request.<br> |
67 | 76 | <br> |
|
77 | 86 | apiclient.errors.HttpError if the response was not a 2xx.<br> |
78 | 87 | httplib2.Error if a transport error has occured.</tt></dd></dl> |
79 | 88 |
|
| 89 | +<dl><dt><a name="HttpRequest-next_chunk"><strong>next_chunk</strong></a>(self, http<font color="#909090">=None</font>)</dt><dd><tt>Execute the next step of a resumable upload.<br> |
| 90 | + <br> |
| 91 | +Can only be used if the method being executed supports media uploads and<br> |
| 92 | +the MediaUpload <a href="__builtin__.html#object">object</a> passed in was flagged as using resumable upload.<br> |
| 93 | + <br> |
| 94 | +Example:<br> |
| 95 | + <br> |
| 96 | + media = MediaFileUpload('smiley.png', mimetype='image/png',<br> |
| 97 | + chunksize=1000, resumable=True)<br> |
| 98 | + request = service.objects().insert(<br> |
| 99 | + bucket=buckets['items'][0]['id'],<br> |
| 100 | + name='smiley.png',<br> |
| 101 | + media_body=media)<br> |
| 102 | + <br> |
| 103 | + response = None<br> |
| 104 | + while response is None:<br> |
| 105 | + status, response = request.<a href="#HttpRequest-next_chunk">next_chunk</a>()<br> |
| 106 | + if status:<br> |
| 107 | + print "Upload %d%% complete." % int(status.progress() * 100)<br> |
| 108 | + <br> |
| 109 | + <br> |
| 110 | +Returns:<br> |
| 111 | + (status, body): (ResumableMediaStatus, <a href="__builtin__.html#object">object</a>)<br> |
| 112 | + The body will be None until the resumable media is fully uploaded.</tt></dd></dl> |
| 113 | + |
| 114 | +<dl><dt><a name="HttpRequest-to_json"><strong>to_json</strong></a>(self)</dt><dd><tt>Returns a JSON representation of the <a href="#HttpRequest">HttpRequest</a>.</tt></dd></dl> |
| 115 | + |
| 116 | +<hr> |
| 117 | +Static methods defined here:<br> |
| 118 | +<dl><dt><a name="HttpRequest-from_json"><strong>from_json</strong></a>(s, http, postproc)</dt><dd><tt>Returns an <a href="#HttpRequest">HttpRequest</a> populated with info from a JSON <a href="__builtin__.html#object">object</a>.</tt></dd></dl> |
| 119 | + |
80 | 120 | <hr> |
81 | 121 | Data descriptors defined here:<br> |
82 | 122 | <dl><dt><strong>__dict__</strong></dt> |
|
111 | 151 | apiclient.discovery.build("plus", "v1", requestBuilder=requestBuilder)<br> |
112 | 152 | <br> |
113 | 153 | Methods that you do not supply a response for will return a<br> |
114 | | -200 OK with an empty string as the response content or raise an excpetion if<br> |
115 | | -check_unexpected is set to True. The methodId is taken from the rpcName<br> |
| 154 | +200 OK with an empty string as the response content or raise an excpetion<br> |
| 155 | +if check_unexpected is set to True. The methodId is taken from the rpcName<br> |
116 | 156 | in the discovery document.<br> |
117 | 157 | <br> |
118 | 158 | For more details see the project wiki.<br> </tt></td></tr> |
119 | 159 | <tr><td> </td> |
120 | 160 | <td width="100%">Methods defined here:<br> |
121 | | -<dl><dt><a name="RequestMockBuilder-__call__"><strong>__call__</strong></a>(self, http, postproc, uri, method<font color="#909090">='GET'</font>, body<font color="#909090">=None</font>, headers<font color="#909090">=None</font>, methodId<font color="#909090">=None</font>)</dt><dd><tt>Implements the callable interface that discovery.build() expects<br> |
| 161 | +<dl><dt><a name="RequestMockBuilder-__call__"><strong>__call__</strong></a>(self, http, postproc, uri, method<font color="#909090">='GET'</font>, body<font color="#909090">=None</font>, headers<font color="#909090">=None</font>, methodId<font color="#909090">=None</font>, resumable<font color="#909090">=None</font>)</dt><dd><tt>Implements the callable interface that discovery.build() expects<br> |
122 | 162 | of requestBuilder, which is to build an <a href="__builtin__.html#object">object</a> compatible with<br> |
123 | 163 | <a href="#HttpRequest">HttpRequest</a>.execute(). See that method for the description of the<br> |
124 | 164 | parameters and the expected response.</tt></dd></dl> |
|
0 commit comments