如何在网址中转义#符号? [英] How to escape # symbol in url?

查看:167
本文介绍了如何在网址中转义#符号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在URL中有#个符号作为参数传递.但是它将丢弃#之后的所有参数值.请给我建议解决方案.以下是我的网址

I had # symbol to pass as parameter in my URL. But it is discarding all the parameter values after #. Kindly suggest me solution. Following is my url

GetConnectiont?   
  customerID=customer1&activenode=Sv50&parent=server&frame=imHealthCheckFrame&
connectedFrom=healthCheck&username=root&password=anil#1234&fromAskUsrPwd=askPassword

预先感谢

推荐答案

您需要对可能包含#的参数进行编码,然后在服务器端代码中对参数进行解码.

You would need to encode the parameters that may contain # and then decode back the parameter in server side code.

您可以使用互联网上的许多资源对字符串进行URL编码,例如.在您的情况下, anil#1234 变为 anil%231234 .

You can use many resources in the internet to URL-encode strings, like this. In your case, anil#1234 becomes anil%231234.

这篇关于如何在网址中转义#符号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆