开发者

What is the correct way to encode + and & characters in URL

I have WCF REST service which retrieves tags from database. Some tags have special chars like &, +, #, (, ) in them. I am able to retrieve tags with #, (, and ) by url encoding the query string.

But I am not able to retrieve tags with 开发者_开发知识库'&' and '+' by url encoding the query string.

I would like to know the solution for this.

Thanks


Convert

+ => %2b
& => %26
, => %2c

UPDATE:

But for "#" its impossible, because, anything after # character is not send to server side, you could only do that in client side with javascript


a+b is written as a%2Bb

a&b is written as a%26b

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜