[Python] How to get the origin URL in FastAPI?

Discussão em 'Python' iniciado por Stack, Dezembro 8, 2024.

  1. Stack

    Stack Membro Participativo

    Is it possible to get the URL that a request came from in FastAPI?

    For example, if I have an endpoint that is requested at api.mysite.com/endpoint and a request is made to this endpoint from www.othersite.com, is there a way that I can retrieve the string "www.othersite.com" in my endpoint function?

    Continue reading...

Compartilhe esta Página