Our system is accepting a text file upload and is supposed to have a pre-determined line count. If the line count doesn't match up, I want to send a warning of sorts back to the user asking to confirm that they want to upload anyway.
Is there a particular status code I can use for something like this?
You can use 422.
The 422 (Unprocessable Entity) status code means the server understands the content type of the request entity (hence a 415(Unsupported Media Type) status code is inappropriate), and the syntax of the request entity is correct (thus a 400 (Bad Request) status code is inappropriate) but was unable to process the contained instructions.
You can check this out.
rest API Tutorial - HTTP Status Codes
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With