code: def _attach_obj(self, req, obj):
          
  
          # Attach the object to the request
          json.dump(obj, req)
  
          # Also set the content-type header
          req['content-type'] = self._content_type
docs: Helper method to attach obj to req as JSON data.