Esempio n. 1
0
        private T ReadResponse <T>(AcsRequest <T> request, HttpResponse httpResponse, FormatType?format) where T : AcsResponse
        {
            IReader             reader  = ReaderFactory.CreateInstance(format);
            UnmarshallerContext context = new UnmarshallerContext();
            string body = System.Text.Encoding.UTF8.GetString(httpResponse.Content);

            context.ResponseDictionary = reader.Read(body, request.ActionName);
            context.HttpResponse       = httpResponse;;
            return(request.GetResponse(context));
        }
        private T ReadResponse <T>(AcsRequest <T> request, HttpResponse httpResponse, FormatType?format)
            where T : AcsResponse
        {
            var reader  = ReaderFactory.CreateInstance(format);
            var context = new UnmarshallerContext();
            var body    = Encoding.UTF8.GetString(httpResponse.Content);

            context.ResponseDictionary = request.CheckShowJsonItemName()
                ? reader.Read(body, request.ActionName)
                : reader.ReadForHideArrayItem(body, request.ActionName);

            context.HttpResponse = httpResponse;
            return(request.GetResponse(context));
        }