This commit is contained in:
Vashchuk Nikita 2021-07-26 20:07:00 +03:00
parent 8a51dee296
commit 81299cc766

View File

@ -1,17 +1,12 @@
using System;
using System.IO;
using System.Net;
using System.Net.Http;
using System.Security.Cryptography;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
using ASC.Common;
using ASC.Common.Logging;
using ASC.Core;
using ASC.Web.Webhooks;
using ASC.Webhooks.Dao.Models;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
@ -42,23 +37,10 @@ namespace ASC.Webhooks
for (int i = 0; i < repeatCount; i++)
{
try
{
var testRequest = new HttpRequestMessage(HttpMethod.Post, "http://localhost:8092/api/2.0/authentication.json");
string httpContent = @"{ ""userName"":""www.vna-97@mail.ru"", ""password"":""265676-333"" }";
testRequest.Content = new StringContent(
httpContent,
Encoding.UTF8,
"application/json");
var testResponse = httpClient.Send(testRequest);
//HttpResponseMessage testResponseCalendar =httpClient.GetAsync("http://localhost:8092/api/2.0/calendar/info");
//var token = "1FR2TsR3kXu2zor7fModuf/3nBJRPI4I7LG5x3ODzTVVgFmUd3NguHEmVqDNMJkNc7MRJjeacv+UaAOlRmLcUyCBtEt54Hzd6TCADQtzUEVvl2M20tX0uYd8sftTdIn/faWV415KXFsY3E16StTZ5A==";
{
var request = new HttpRequestMessage(HttpMethod.Post, URI);
request.Headers.Add("Accept", "*/*");
request.Headers.Add("Secret","SHA256=" + GetSecretHash(secretKey, webhookRequest.Data));
//request.Headers.Add("Authorization", token);
request.Content = new StringContent(
webhookRequest.Data,