public JsonContent(object obj, JsonSerializer jsonSerializer) { pooledStream = PooledStream.Acquire(); jsonSerializer.Serialize(pooledStream.StreamWriter, obj); pooledStream.StreamWriter.Flush(); Headers.ContentType = PayUContainer.ContentJson; }
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"); }