publishers_24.py 357 B

12345678910
  1. def post(self, where, **query):
  2. """Returns the API URI for the newly created item."""
  3. body = json.dumps(query, cls=JSONEncoder)
  4. item_url = self.url % where
  5. h = httplib2.Http()
  6. response, content = h.request(
  7. item_url, method="POST", body=body, headers=self.headers
  8. )
  9. return response["status"] == "201", response, content