from typing import Dict
from typing import Any
from typing import Optional
import requests


def request_data(url: str, params: Dict[str, Any]) -> Optional[str]:
    """Request data about energy production from Entsoe API.

    Args:
        url (str): Entsoe API url.
        params (Dict[str, str]): Parameters for the API get requests.

    Returns:
        Optional[str]: If response status is ok returns xml response as a string.
    """
    headers = {
        'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:83.0) Gecko/20100101 Firefox/83.0'
    }
    r = requests.get(url, params=params, headers=headers)
    if r.status_code == 200:
        return r.text
    return None