isSuccess function

bool isSuccess(
  1. int statusCode
)

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, otherwise false.

Implementation

bool isSuccess(int statusCode) => statusCode == 200 || statusCode == 201;