Created
October 30, 2016 14:20
-
-
Save lenkan/db28050fe8653890ac93e9f2ace7ba03 to your computer and use it in GitHub Desktop.
A System.Net.Http.HttpContent for json data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Net.Http; | |
using System.Text; | |
using Newtonsoft.Json; | |
namespace Lenkan.StrengthLog.Data.Couch | |
{ | |
public class JsonContent : StringContent | |
{ | |
public JsonContent(string s) : base(s, Encoding.UTF8, "application/json") | |
{ } | |
public JsonContent(object o) : this(JsonConvert.SerializeObject(o)) | |
{ } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
works perfect! thank you.