def _get_data_bytes_or_stream_only(param_name, param_value):
    '''Validates the request body passed in is a stream/file-like or bytes
    object.'''
    if param_value is None:
        return b''

    if isinstance(param_value, bytes) or hasattr(param_value, 'read'):
        return param_value

    raise TypeError(_ERROR_VALUE_SHOULD_BE_BYTES_OR_STREAM.format(param_name))
Validates the request body passed in is a stream/file-like or bytes
    object.