0

I have a field that I can insert a certain name and find the user with the correspondent name,that was developed in react. My code works when that name is like "test", but if the name is like "this test" (if the name has a space on it), my backend receives the name in this format ("this%20test") and when I am searching for that name on the database, the entry returns null. How can I solve this? I want to solve this on my frontend because I think it´s the best option.

jose azevedo
  • 235
  • 2
  • 3
  • 18

1 Answers1

1

Any parameters passed as query params will be url-encoded and passed to your backend. You need to url decode parameters in your backend.

See this to url decode in java https://stackoverflow.com/a/6138183/3295987

Pratapi Hemant Patel
  • 2,910
  • 1
  • 18
  • 29