I am trying to call a java GET RESTful service with an email address from Ionic 2 (javascript). It works fine, however when I add a dot (e.g. .com) to the email address it looses all the characters from the dot when it reaches the service.
How do I encode the URI in order to send an email address to the service please?
I am using:
'/list/email/' + encodeURIComponent(email)
but if the email address is: [email protected]
, it reaches the service as email@domain
.
I have tried:
'/list/email/' + email
'/list/email/' + encodeURI(email)
'/list/email/' + encodeURIComponent(email)
all give the same result
Thanks
The FIX is simple. Just add a '/' on the end of the url
return this.http.get(this.BASE_URI + '/list/email/' + email + '/')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With