如何获取网址的哈希值? [英] How can I get the hash of an url?
本文介绍了如何获取网址的哈希值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的网址是:
http://localhost:4567/Test/Callback#state=test&access_token=....
但是当调用 Request.Url.ToString();
时,它只会输出
But when calling Request.Url.ToString();
it just outputs
http://localhost:4567/Test/Callback
如何将完整的url发送到服务器?
How can I get the full url send to the server?
推荐答案
您不能.
哈希(#
)和查询字符串(?
)之间有很大的区别.查询字符串将发送到服务器,而哈希不是.
There is a big difference between hash (#
) and query string (?
). The query string is send to the server, the hash isn't.
因此发送到服务器 http://localhost:4567/Test/Callback
.
将哈希"发送到服务器的唯一选择是使用查询字符串:
The only option you have to get the 'hash' to the server is by using a query string:
http://localhost:4567/Test/Callback?state=test&access_token=...
这篇关于如何获取网址的哈希值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文