0

I have come up with a problem while using query params in ember.js.when I access query params from URL it strips out certain characters like "+" and adds "space" instead of it.is there any solution to get exact parameter from URL so that I can send it as a request object.

example

UpA++P1wwB1uoAJQkxe3CySxIXj5so5G

UpA P1wwB1uoAJQkxe3CySxIXj5so5G (two space characters after A)

Vivekraj K R
  • 2,418
  • 2
  • 19
  • 38
  • 1
    `+` is an outdated way of representing spaces in URLs. If they are being changed into spaces, this means that you need to url-encode your values before passing them into whatever is building these URLs. You haven't shown us any of your code, so it's hard to tell you where that fix would be. – JLRishe Feb 15 '17 at 07:04
  • @JLRishe Actual problem is I need to get the exact value as in url.when im trying to encode it. adds "%20" instead of "+". – Vivekraj K R Feb 15 '17 at 07:20
  • Clearly something is converting the `+`es into spaces. You need to encode the value before that happens. If you're getting `%20`, that means that you're encoding it after the `+`es have already been turned into spaces, which is too late. – JLRishe Feb 15 '17 at 08:06

1 Answers1

1

I guess you can't represent ; / ? : @ & = + $ , these characters in URL without encoding. You need to decodeURIComponent to get those values back.

Ember Freak
  • 12,918
  • 4
  • 24
  • 54