You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given a request like this: http://localhost:5000/echo?text=Hello%20World how can I get the hostname and the port number?
As far as I can see this information is (only) available in the request.header() in a Header called Host.
The server has the server.server_addr() that would return them in like this: 127.0.0.1:5000.
IMHO it would be useful for both the server and the request to have method: host and port.
The text was updated successfully, but these errors were encountered:
server_addr() is more complicated than that. It returns you a ListenAddr which may be a TCP socket or a Unix path, and it's up to you to decide how to handle those cases for your application.
Given a request like this:
http://localhost:5000/echo?text=Hello%20World
how can I get the hostname and the port number?As far as I can see this information is (only) available in the
request.header()
in aHeader
calledHost
.The
server
has theserver.server_addr()
that would return them in like this:127.0.0.1:5000
.IMHO it would be useful for both the
server
and therequest
to have method:host
andport
.The text was updated successfully, but these errors were encountered: