Skip to the content.

Response Handler

Implement default behaviour for Graph calls. These can be used either by generated Request classes or called directly by developers using native libraries.


Example Usage

  var responseHandler = new ResponseHandler(new Serializer());

  var response = await httpClient.SendAsync(request);
  if (response.IsSuccessCode()) {
      User user = responseHandler.HandleSuccessfulResponse<User>(response);
      return user;
  } else {
      ErrorContent error = responseHandler.HandleErrorResponse(response);
      throw new ServiceException(error);