Esempio n. 1
0
        public HttpContent Serialize(object obj)
        {
            var content = new StreamContent(serializer.Serialize(obj));

            content.Headers.ContentType = new MediaTypeHeaderValue(MediaType.Text.Plain);
            return(content);
        }
Esempio n. 2
0
        public HttpContent Serialize(object obj)
        {
            var stream  = serializer.Serialize(obj);
            var content = new StreamContent(stream);

            content.Headers.ContentType = new MediaTypeHeaderValue(MediaType.Application.Json);
            return(content);
        }