Beispiel #1
0
        public async Task <Response <T> > ExecuteTaskAsync <T>(Request request)
        {
            IRestResponse <T> restResponse = null;

            //generating rest request
            var restRequest =
                RequestMapper.MapRequestToRestRequest(request);

            //execute request
            restResponse = await ExecuteRequest <T>(restRequest, request.Method, request.BaseUrl);

            //check for time out and log request/response/error
            //_requestResponseLogger.Log(restRequest, restResponse);

            //generate response from RestResponse
            return(ResponseMapper.MapRestResponseToResponse(restResponse));
        }
Beispiel #2
0
        public async Task <Response <R> > ExecuteTaskAsync <T, R>(Request <T> request)
        {
            try
            {
                IRestResponse <R> restResponse = null;

                //generating rest request
                var restRequest =
                    RequestMapper.MapRequestToRestRequest(request, request.Data);

                //execute request
                restResponse = await ExecuteRequest <R>(restRequest, request.Method, request.BaseUrl);

                //check for time out and log request/response/error
                //_requestResponseLogger.Log(restRequest, restResponse);

                //generate response from RestResponse
                return(ResponseMapper.MapRestResponseToResponse(restResponse));
            }
            catch (System.Exception ex)
            {
                throw ex;
            }
        }