Пример #1
0
        public void Write(string key, Data value)
        {
            IHttpRequest request = remoteHttpServer.CreatePostRequest("Write");

            request.BodyStream.WriteBytes(jsonSerializer.Serialize(new WriteParameters {
                Key = key, Value = value
            }));
            request.SendOrDie();
        }
Пример #2
0
        public Data Read(string key)
        {
            IHttpRequest request = remoteHttpServer.CreatePostRequest("Read");

            request.BodyStream.WriteBytes(jsonSerializer.Serialize(new ReadParameters {
                Key = key
            }));
            var response = request.SendOrDie();

            return(jsonSerializer.Deserialize <Data>(response.BodyStream.ReadToEnd()));
        }