Added support for requests that return an HTTP 204: No Content. Added tests for creating a private activity and for deleting activities.
diff --git a/apiclient/discovery.py b/apiclient/discovery.py
index db17cea..945db74 100644
--- a/apiclient/discovery.py
+++ b/apiclient/discovery.py
@@ -114,6 +114,9 @@
# Error handling is TBD, for example, do we retry
# for some operation/error combinations?
if resp.status < 300:
+ if resp.status == 204:
+ # A 204: No Content response should be treated differently to all the other success states
+ return simplejson.loads('{}')
return simplejson.loads(content)['data']
else:
logging.debug('Content from bad request was: %s' % content)