Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 21
    This returns hostname of the server you are receiving request on. It will work only if you are running your API and website on the same server and originating and receiving party is the same host. Commented Jul 4, 2019 at 8:14
  • 1
    this returns the hostname of the server that is hosting the code, not the originating..... Commented Sep 21, 2022 at 2:14
  • "Contains the hostname derived from the Host HTTP header", and " The Host request header specifies the host and port number of the server to which the request is being sent"... So this is not the origin... Commented May 15, 2023 at 22:02