def _get_content(self, request, data):
        """Get the content from the request.

        If it is file-based, return the contents of the file.

        Args:
            request: The django request object.
        Returns:
            The content of the string/file.
        """
        if 'application/json' in request.content_type:
            try:
                return data['content']
            except __HOLE__, e:
                msg = "No content provided"
                logger.warning(msg)
                raise NoContentError(msg)
        elif 'multipart/form-data' in request.content_type:
            if not request.FILES:
                msg = "No file has been uploaded."
                logger.warning(msg)
                raise NoContentError(msg)
            return content_from_uploaded_file(request.FILES)
        else:
            msg = "No content or file found"
            logger.warning(msg)
            raise NoContentError(msg)
dataset/ETHPy150Open rvanlaar/easy-transifex/src/transifex/transifex/resources/api.py/ResourceHandler._get_content