def _http_request(self, request_url: str, request_method: str='GET', request_headers: (dict or None)=None, request_data: (bytes or None)=None) -> dict:
    http_request = request.Request(request_url, method=request_method)
    if request_headers:
        http_request.headers = request_headers
    if request_data:
        http_request.data = request_data
    try:
        with request.urlopen(http_request) as http_response:
            response_status = http_response.getcode()
            response_headers = http_response.info()
            response_data = http_response.read()
    except HTTPError as http_response_not_ok:
        response_status = http_response_not_ok.getcode()
        response_headers = http_response_not_ok.info()
        response_data = http_response_not_ok.read()
    return {'status': response_status, 'headers': response_headers, 'data': response_data}
def _http_request(self, request_url: str, request_method: str='GET', request_headers: (dict or None)=None, request_data: (bytes or None)=None) -> dict:
    http_request = request.Request(request_url, method=request_method)
    if request_headers:
        http_request.headers = request_headers
    if request_data:
        http_request.data = request_data
    try:
        with request.urlopen(http_request) as http_response:
            response_status = http_response.getcode()
            response_headers = http_response.info()
            response_data = http_response.read()
    except HTTPError as http_response_not_ok:
        response_status = http_response_not_ok.getcode()
        response_headers = http_response_not_ok.info()
        response_data = http_response_not_ok.read()
    return {'status': response_status, 'headers': response_headers, 'data': response_data}