Сообщение Re[10]: обработка ошибок от 12.04.2022 17:26
Изменено 12.04.2022 17:35 MadHuman
Y>Может быть, я всё неправильно понимаю. Просветите меня.
Y>https://datatracker.ietf.org/doc/html/rfc2616#section-10.4.1
Y>
Y>10.4.1 400 Bad Request
Y> The request could not be understood by the server due to malformed
Y> syntax. The client SHOULD NOT repeat the request without
Y> modifications.
для 400 расширилась трактовка — здесь
The 400 (Bad Request) status code indicates that the server cannot or will not process the request due to something
that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing)
так что, норм 400 если сами данные невалидны с точки зрения сервера
Y>Может быть, я всё неправильно понимаю. Просветите меня.
Y>https://datatracker.ietf.org/doc/html/rfc2616#section-10.4.1
Y>
Y>10.4.1 400 Bad Request
Y> The request could not be understood by the server due to malformed
Y> syntax. The client SHOULD NOT repeat the request without
Y> modifications.
для 400 расширилась трактовка — здесь
The 400 (Bad Request) status code indicates that the server cannot or will not process the request due to something
that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing)
так что, норм 400 если синтаксис ок, но сами данные невалидны с точки зрения сервера.
причем ещё для такого кейса вполне ок и 422, но с одной стороны он вроде как бы был специфичен для WebDAV
и я не понял, есть ли однозначный консенсус не нему на текущий момент.
но 400 точно ок.