• Post Reply Bookmark Topic Watch Topic
  • New Topic

Ampsersand in url  RSS feed

 
Noette Alle
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,
I am setting up a url query string with 2 parameters such as http://whaterver.com?value1=something1&value2=something2
However, one of my query values has an ampersand, like this:
http://whatever.com?value1=r&d&value2=something2.
How do I pass the value "r&d" without misinterpreting the "&" as another query param?
Thanks in advance
 
Ron Newman
Ranch Hand
Posts: 1056
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See the static method URLEncoder.encode() . you should do this to each of your parameter values, or at least each parameter value that might contain an unusual character such as "&".
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!