Exemplo n.º 1
0
        public string Status()
        {
            var cloud = new QWebClient(this.baseUrl);

            var result = cloud.Get("/status");

            Console.WriteLine("Result from get /status:");
            Console.WriteLine(result);

            return(result);
        }
Exemplo n.º 2
0
        public string Test(string req)
        {
            var cloud = new QWebClient(this.baseUrl);

            var result = cloud.Get("/");

            Console.WriteLine("Result from get /:");
            Console.WriteLine(result);

            return(result);
        }
Exemplo n.º 3
0
        public IQuelleSearchResult Search(QRequestSearch req)
        {
            var cloud = new QWebClient(this.baseUrl);

            if (cloud != null)
            {
                try
                {
                    var payload        = JsonSerializer.Serialize(req);
                    var packedResponse = cloud.Post("/search", payload, mimetype);
                    var str            = System.Text.Encoding.Default.GetString(packedResponse.data).Trim();
                    var response       = JsonSerializer.Deserialize <QSearchResult>(packedResponse.data);
                    return(response);
                }
                catch (Exception ex)
                {
                    var bad = new QSearchResult();
                    bad.AddError("Unable to pack message (before calling search provider)");
                    return(bad);
                }
            }
            return(null);
        }