[Python] Should changing website certificate to secure mess with api calls?

Discussão em 'Python' iniciado por Stack, Abril 28, 2025.

  1. Stack

    Stack Membro Participativo

    So I have been using the code below to fetch a list I needed for my website from an api of mine. I recently converted the certificate of the api hosting website to secure, issue is now my api is not accepting the authorisation I gave it earlier returning a 401.

    def fetchAPIList():
    try:
    list= requests.get("https://website/api/list", headers={"Authorization": f'Bearer {key}'})
    return list.json()
    except Exception as e:
    print(e)
    raise e


    The only change I have made to my code is http becoming https, is there something I have missed? Do the headers need to be changed when switching to secure?

    Continue reading...

Compartilhe esta Página