Search code examples
pythonsanic

How do I get hostname by sanic?


I am using sanic to create a API server but I can't find how to get the hostname on the docs.

Is there a reference of getting the hostname in sanic?


Solution

  • What you want is actually in the documentation:

    https://sanic.readthedocs.io/en/latest/sanic/request_data.html