private void SendRequest(IRequest request, Handler handler, OnSucessfulRequest onSucessfulRequest, OnFailure failureCallback) { try { Response response = _httpInvoker.PostInSession(_baseUri, request, _xmlParser, handler, _sessionId); if (response.IsOk) { if (handler.IsOk) { onSucessfulRequest(); } else { failureCallback(new FailureResponse(false, handler.Message, handler.Content, null)); } } else { failureCallback(new FailureResponse(true, "HttpStatus: " + response.Status + ", for: " + _baseUri + request.Uri)); } } catch (Exception e) { failureCallback(new FailureResponse(e, "URI: " + _baseUri + request.Uri)); } }