Last updated 4 years ago
Use the status() function to return JSON data with an .
status()
This function is useful when returning errors.
status(..., status code)
The same as .
Integer.
.
@get('/greet'): if require_keys(['name', 'age'], body): status('Please provide all required parameters.', 400) respond({ name: body['name'], age: body['age'] })
respond()