-
Improvement
-
Resolution: Duplicate
-
Minor
-
None
-
3.7.2, 4.3
-
None
-
MOODLE_37_STABLE, MOODLE_403_STABLE
When Moodle's built-in web services return an exception, this is often or always returned with an HTTP status 200. For example, if we submit a request to mod_assign_save_grade with an invalid parameter, we receive the response:
Exception: invalid_parameter_exception
|
Error Code: invalidparameter
|
Message: Invalid parameter value detected
|
This is returned with an HTTP status code 200 (OK). The 200 code is supposed to indicate that a request succeeded. It is not the appropriate code to use if we passed in bad parameters and got back an exception. A more appropriate code for this example would be 400 (Bad Request).
Use of the correct HTTP status codes would allow our client-side code to more elegantly handle responses from the server without having to parse every single response for exceptions.
- will be (partly) resolved by
-
MDL-76834 Web service modernisation
-
- Open
-