Пример #1
0
        public async Task <SandboxItemFireWebhookResponse> ItemFireWebhookAsync(SandboxItemFireWebhookRequest request)
        {
            var data    = JsonSerializer.Serialize(request, SerializerOptions);
            var content = new StringContent(data, Encoding.UTF8, "application/json");

            var httpResponse = await HttpClient.PostAsync("/sandbox/item/fire_webhook", content);

            httpResponse.EnsureSuccessStatusCode();

            var rawResponse = await httpResponse.Content.ReadAsStringAsync();

            return(JsonSerializer.Deserialize <SandboxItemFireWebhookResponse>(rawResponse, SerializerOptions));
        }
Пример #2
0
 public SandboxItemFireWebhookResponse ItemFireWebhook(SandboxItemFireWebhookRequest request)
 {
     return(ItemFireWebhookAsync(request).GetAwaiter().GetResult());
 }