Exemplo n.º 1
0
        public async Task <RequestResult> Query(Expr query)
        {
            var json   = JsonConvert.SerializeObject(query, Settings);
            var result = await _clientIo.DoRequest(HttpMethod.Post, "", json);

            RaiseForStatusCode(result);
            return(result);
        }
Exemplo n.º 2
0
        async Task <Value> Execute(HttpMethodKind action, string path, Expr data = null, IReadOnlyDictionary <string, string> query = null, TimeSpan?queryTimeout = null)
        {
            var dataString   = data == null ?  null : JsonConvert.SerializeObject(data, Formatting.None);
            var responseHttp = await clientIO.DoRequest(action, path, dataString, query, queryTimeout).ConfigureAwait(false);

            RaiseForStatusCode(responseHttp);

            var responseContent = FromJson(responseHttp.ResponseContent);

            return(responseContent["resource"]);
        }