Convert the response wire format into a Python object. Args: resp: httplib2.Response, the HTTP response headers and status content: string, the body of the HTTP response Returns: The body de-serialized as a Python object. Raises: goo
(self, resp, content)
| 215 | LOGGER.info("--response-end--") |
| 216 | |
| 217 | def response(self, resp, content): |
| 218 | """Convert the response wire format into a Python object. |
| 219 | |
| 220 | Args: |
| 221 | resp: httplib2.Response, the HTTP response headers and status |
| 222 | content: string, the body of the HTTP response |
| 223 | |
| 224 | Returns: |
| 225 | The body de-serialized as a Python object. |
| 226 | |
| 227 | Raises: |
| 228 | googleapiclient.errors.HttpError if a non 2xx response is received. |
| 229 | """ |
| 230 | self._log_response(resp, content) |
| 231 | # Error handling is TBD, for example, do we retry |
| 232 | # for some operation/error combinations? |
| 233 | if resp.status < 300: |
| 234 | if resp.status == 204: |
| 235 | # A 204: No Content response should be treated differently |
| 236 | # to all the other success states |
| 237 | return self.no_content_response |
| 238 | return self.deserialize(content) |
| 239 | else: |
| 240 | LOGGER.debug("Content from bad request was: %r" % content) |
| 241 | raise HttpError(resp, content) |
| 242 | |
| 243 | def serialize(self, body_value): |
| 244 | """Perform the actual Python object serialization. |
nothing calls this directly
no test coverage detected