• Post Reply Bookmark Topic Watch Topic
  • New Topic

Remove special characters from request parameters  RSS feed

 
Pratap Bane
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

We need getting JSON formated string as request parameter but, that contains the special characters like '&', because of this there was exception while getting request parameter.
Kindly help me in this case.
 
Ron McLeod
Saloon Keeper
Posts: 1562
222
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you trying to put JSON formatted data in the request URI?

Can you give an example?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37181
515
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, please show the stack trace of the exception.
 
Paul Clapham
Sheriff
Posts: 22375
42
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should URL-encode the data before using it as a request parameter.

It's unclear from your post whether you are the one creating the request, or whether you are receiving malformed requests from somebody else. If it's somebody else sending you bad data, then they should be told to stop it. If you get an exception and their malformed data isn't processed, you shouldn't feel bad about that.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!