I am about to implement a REST api. I want to know what's the difference between HttpStatus.OK
and HttpStatus.ACCEPTED
:
return new ResponseEntity<User>(u, HttpStatus.OK));
And
return new ResponseEntity<User>(u, HttpStatus.ACCEPTED);
As per Spring documentation given on this link
HttpStatus.OK
200 Ok means The request has succeeded. The information returned with the response is dependent on the method used in the request
HttpStatus.ACCEPTED:
202 Accepted. means The request has been accepted for processing, but the processing has not been completed. The request might or might not eventually be acted upon, as it might be disallowed when processing actually takes place.
for More information on HTTP response Status Code Definitions please visit this link
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