3

I am using Angular2+ with in-memory-web-api and I am trying to do a simple query string. I am passing an exact email address to check if the user already exists. My createDB has a couple users with a propertyName of 'loginEmail' and these emails:

The API URL looks like this:

api/accounts/?loginEmail=

If I pass:

john

I get one object to return. If I pass:

email.com

I get both objects to return. But, if I pass:

[email protected] or john@

I get 404 - Not Found

Does anyone know why this thing is bugging out on the @ character and how to get the in-memory-web-api to return an object correctly when passing an email address?

Thanks!

1 Answer 1

3

A few people helped me resolve this issue...

You can use the encodeURIComponent function on the email argument so the @ sign is returned correctly. I am using the string literal detailed below and it is now working correctly:

`${this.apiUrl}/?loginEmail=${encodeURIComponent(email)}`
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.