def _attach_obj(self, req, obj):
        """Helper method to attach obj to req as JSON data."""

        # Attach the object to the request
        json.dump(obj, req)

        # Also set the content-type header
        req['content-type'] = self._content_type
Helper method to attach obj to req as JSON data.