isSuccess function
Checks if a given HTTP status code represents a successful response.
Parameters:
statusCode
(int
): The HTTP status code to check.
Returns:
bool
:true
if the status code is 200 or 201, otherwisefalse
.
Implementation
bool isSuccess(int statusCode) => statusCode == 200 || statusCode == 201;