def parse_content_type(request):
    """
    This function is used to extract the content type from the header.
    """
    try:
        content_type = request.headers['content-type']
    except:
        raise error_views.InvalidParametersError('No Content-Type provided')

    json_type = 'application/json'
    data_type = 'multipart/form-data'
    lower_content_type = content_type.lower()
    if lower_content_type.find(json_type) >= 0:
        return json_type
    elif lower_content_type.find(data_type) >= 0:
        return data_type
    else:
        raise error_views.InvalidParametersError('Invalid Content-Type')