Exemplo n.º 1
0
        public async Task<string> SessionCreateAsync(Session session)
        {
            var uri = GetRequestUri("session/create");

            var request = new HttpRequestMessage(HttpMethod.Put, uri);
            request.Content = new StringContent(JsonConvert.SerializeObject(session), Encoding.UTF8, "application/json");
            var response = await Execute(request);
            var json = await response.Content.ReadAsStringAsync();
            return JObject.Parse(json)["id"].Value<string>();
        }
Exemplo n.º 2
0
        // TimeSpan lockDelay, string name, string node, IEnumerable<string> checks

        public string SessionCreate(Session session)
        {
            return SessionCreateAsync(session).ExecuteSync();
        }