do browsers remove # in URL automatically?

前端 未结 5 2106
悲哀的现实
悲哀的现实 2021-01-06 19:22

our front end guy needs to form a url containing the hash, (i.e, http://blah/#some-link.) when we hit this on the browser and inspect the http traffic using fiddler, we saw

5条回答
  •  忘掉有多难
    2021-01-06 19:40

    The part of the URI including and after the hash (#) is never sent to the server as part of the HTTP request.

    The reason is that the hash identifier was originally designed to point at references within the given web page and not to new resources on the server.

    If you want to get the hash identifier, you'll have to use some client-side JavaScript to grab the value and submit it with the form.

提交回复
热议问题