[Python] Error: ('Connection aborted.', ConnectionResetError(10054, 'An existing connection...

Discussão em 'Python' iniciado por Stack, Agosto 2, 2025.

  1. Stack

    Stack Membro Participativo

    When calling the API-


    import requests

    url = "https://api.themoviedb.org/3/movie/98?language=en-US"

    headers = {
    "accept": "application/json",
    "Authorization": "Bearer eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJjOTA5NTllZDlhODNmZjMwNDUxNmFjZWU4MjZkMDgxOSIsIm5iZiI6MTc1NDE1NjU1MC4wMiwic3ViIjoiNjg4ZTRlMDZiMzQxOWNhN2RhN2NmMThjIiwic2NvcGVzIjpbImFwaV9yZWFkIl0sInZlcnNpb24iOjF9.gtqj0_-PbxWWVXpLwB1ZfS_RFrUr3IWV4uPcGV2SDXg"
    }

    response = requests.get(url, headers=headers)

    print(response.text)


    I get the error-

    Error: ('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))


    When going through the API docs given at https://developer.themoviedb.org/reference/movie-details, I see that the API test given on the page works fine on the website, but when tried locally gives the error. I see that some websites say, that this is more of a network related issue, but am unable to resolve it.
    I am unable to understand the issue here and resolve it. Please help!!

    Continue reading...

Compartilhe esta Página