2015-08-02 17:39:32 +00:00
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Net;
|
|
|
|
|
using System.Net.Http;
|
|
|
|
|
using System.Net.Http.Headers;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace Jackett.Utils
|
|
|
|
|
{
|
2017-04-15 08:45:10 +00:00
|
|
|
|
public class JsonContent : StringContent
|
|
|
|
|
{
|
|
|
|
|
public JsonContent(object value)
|
|
|
|
|
: this(value, Encoding.UTF8)
|
|
|
|
|
{
|
|
|
|
|
Headers.ContentType.CharSet = "utf-8";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public JsonContent(object value, Encoding encoding)
|
|
|
|
|
: base(JsonConvert.SerializeObject(value, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore }), encoding, "application/json")
|
|
|
|
|
{
|
|
|
|
|
}
|
2015-08-02 17:39:32 +00:00
|
|
|
|
}
|
|
|
|
|
}
|