简体   繁体   English

我如何通过 sanic 获取主机名?

[英]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.我正在使用sanic创建 API 服务器,但我找不到如何在文档中获取主机名。

Is there a reference of getting the hostname in sanic?是否有在 sanic 中获取主机名的参考?

What you want is actually in the documentation:你想要的实际上是在文档中:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM