Esempio n. 1
0
        /// <summary>
        /// Send query as a HTTP POST and return the response
        /// </summary>
        private string GetResponseData(string query)
        {
            StringContent content = new StringContent(query, Encoding.UTF8, "application/json");

            using (var response = _mondayClient.PostAsync("", content))
            {
                if (!response.Result.IsSuccessStatusCode)
                {
                    throw new JsonException($"The response from {_mondayClient.BaseAddress} was {response.Result.StatusCode}");
                }
                return(response.Result.Content.ReadAsStringAsync().Result);
            }
        }