Beispiel #1
0
        public JsonContent(object obj, JsonSerializer jsonSerializer)
        {
            pooledStream = PooledStream.Acquire();

            jsonSerializer.Serialize(pooledStream.StreamWriter, obj);

            pooledStream.StreamWriter.Flush();

            Headers.ContentType = PayUContainer.ContentJson;
        }
Beispiel #2
0
        public JsonContent(object obj, JsonSerializer jsonSerializer = null)
        {
            _pooledStream = PooledStream.Acquire();

            (jsonSerializer ?? DefaultJsonSerializer.Value)
            .Serialize(_pooledStream.StreamWriter, obj);

            _pooledStream.StreamWriter.Flush();

            Headers.ContentType = new MediaTypeHeaderValue("application/json");
        }