Реализован вход в систему в IntersvyazClient.
This commit is contained in:
parent
cb36edfd2e
commit
6ee66e4020
7 changed files with 158 additions and 8 deletions
20
src/Intersvyaz.Net/JsonContent.cs
Normal file
20
src/Intersvyaz.Net/JsonContent.cs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
using System.Text;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using System.Net.Http;
|
||||
|
||||
namespace Intersvyaz.Net
|
||||
{
|
||||
public class JsonContent : StringContent
|
||||
{
|
||||
public JsonContent(object value) : base(Serialize(value), Encoding.UTF8, "application/json") { }
|
||||
|
||||
private static string Serialize(object value)
|
||||
{
|
||||
return JsonConvert.SerializeObject(value, Formatting.None, new JsonSerializerSettings()
|
||||
{
|
||||
ContractResolver = new CamelCasePropertyNamesContractResolver(),
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue