How do you use json?
just imagine you have to login
for example the fields are email and password
you make it to be a json {"email": "myemail@email.com", "password": "_password"}
then you send a request to the server with that json
then server does its work:
1. it checks if this email in the database. if not send response back in json format that can have a message: {"message": "There is no account with this email."}. You can display it to the user on frontend
2. If there is user with that email. Then check password. If it does not match then send response back with the message: {"message": "Wrong password. Try again."}
3. If it's ok. send response back that says : {"message": "success"}