advanced
Backend protocol
If you need to define your own backend logic outside Nitro, follow these requirements.
- Precognitive Requests must have Precognitive Header
{ 'Precognitive': 'true' } - To validate specific variables, each keys must be specified inside the ValidateOnly Header, comma separated and leveraging dot notation:
{ 'Precognition-Validate-Only': 'name,age,address.street,address.number' } - To validate the full Form the ValidateOnly Header should be omitted or define as an empty string.
- Successful validation response must have:
- Precognitive Header
{ 'Precognitive': 'true' } - Precognitive Successful Header
{ 'Precognition-Success': 'true' } - Precognitive Successful status code:
204
- Error validation response must have:
- Precognitive Header
{ 'Precognitive': 'true' } - Precognition-Validate-Only header if needed
{ 'Precognition-Validate-Only': 'name,age,address.street,address.number' } - Validation Error status code:
422 - Validation Errors and Message will be parsed as per your define logic, or using standard
errorParsersif enabled by config:- NuxtErrorParsers:
Response & { _data: { data: ValidationErrorsData }} - LaravelErrorParsers:
Response & { _data: ValidationErrorsData }
- NuxtErrorParsers: