import random


def get_random_user_agent(list_of_user_agents):
    """
    Returns a dictionary containing all necessary header information for a
    request, with a random chosen user agent to bypass being detected
    when scraping.

    Parameters
    ----------------
    list_of_user_agents : list
        A list containing various user agents.

    Returns
    ----------------
    dictionary
        Returns a dictionary of header fields with a random user agent for
        evasion.
    """

    headers = {"Host": "www.metacritic.com",
               "User-Agent": random.choice(list_of_user_agents),
               "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
               "Accept-Language": "en-US,en;q=0.5",
               "Accept-Encoding": "gzip, deflate",
               "Connection": "keep-alive"}

    return headers