def METHOD_NAME(key, value, out):
    if isinstance(value, file):
        out.append('--' + BOUNDARY)
        out.append(
            f'Content-Disposition: form-data; name="{key}"; filename="{value.name}"'
        )
        out.append('Content-Type: %s' % get_content_type(value.name))
        out.append('')
        out.append(value.read())
    elif isinstance(value, list):
        for v in value:
            METHOD_NAME(key, v)
    else:
        out.append('--' + BOUNDARY)
        out.append('Content-Disposition: form-data; name="%s"' % key)
        out.append('')
        out.append(value)