示例#1
0
 public HttpReader(
     SessionFactory sessionFactory,
     HttpStringQueryParser httpQueryParser,
     IConfigurationProvider config,
     ILogger <HttpReader> logger)
 {
     _logger          = logger;
     _sessionFactory  = sessionFactory;
     _httpQueryParser = httpQueryParser;
     _config          = config;
 }
示例#2
0
        public async Task <string> Format(HttpRequest request, ITextModel tokenizer)
        {
            var parser = new HttpStringQueryParser(new QueryParser <string>(_sessionFactory, tokenizer, _log));
            var query  = await parser.ParseRequest(request);

            var dictionary = new Dictionary <string, object>();

            parser.ParseQuery(query, dictionary);

            return(JsonConvert.SerializeObject(dictionary, Formatting.Indented));
        }