Is URL hash available on server using Node.js?

Today I applied this link: Node API doc for 'url' .

I saw that the hash part is included in the documentation. But is this part not available on the server? This is what I always thought.

Any explanation? What didn’t I understand?

+7
source share
2 answers

No, there will be no hash in the URL sent from the client to the server as part of the HTTP request.

But this is not the only case when Node will need to manipulate URLs. You could write server-side code to create a URL that will be inserted into the HTML code sent back to the client (for example, you can have a list of hyperlinks and generate URLs for these hyperlinks).

For this reason, for Node, the URL API makes sense to be complete, even if one part of the URL is not present in one common use case.

+11
source

No, the http client removes it before it requests a server for this page, so the server never has access to it.

0
source

All Articles