예제 #1
0
        /// <summary>
        /// Get from file.
        /// </summary>
        /// <param name="filename">Filename.</param>
        /// <returns>Search file response.</returns>
        private async Task <SearchFileResponse?> GetFromFile(string filename)
        {
            var f = new SimklFile {
                File = filename
            };

            _logger.LogInformation("Posting: {@File}", f);
            return(await Post <SearchFileResponse, SimklFile>("/search/file/", null, f));
        }
예제 #2
0
        public async Task <SearchFileResponse> getFromFile(string filename)
        {
            SimklFile f = new SimklFile {
                file = filename
            };

            _logger.Info("Posting: " + _json.SerializeToString(f));
            StreamReader r = new StreamReader(await _post("/search/file/", null, f));
            string       t = r.ReadToEnd();

            _logger.Debug("Response: " + t);
            return(_json.DeserializeFromString <SearchFileResponse>(t));
        }