Im trying to return a custom HTTP response, based on condition I want to return true or false, the right response is calculated in my /api/validate function
Have tried nummerous things all fail. How to just return true or false?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Your can not return just true or false.
You have to return correct http response with status code. For example
200 OK– true422 Unprocessable Entity– falseOr you can always return 200 OK with hash object converted to JSON in body of your response. Something like