private async Task <ResponseDocument> MakeRequest(string tweetFullText) { var queryString = HttpUtility.ParseQueryString(string.Empty); var uri = "https://westeurope.api.cognitive.microsoft.com/text/analytics/v2.0/sentiment?" + queryString; HttpResponseMessage response; // Request body var requestBody = new RequestRootObject { Documents = new List <RequestDocument> { new RequestDocument { Language = _configuration.Language ?? "en", Id = "1", Text = tweetFullText } } }; var serializedRequestBody = JsonConvert.SerializeObject(requestBody); var byteData = Encoding.UTF8.GetBytes(serializedRequestBody); using (var content = new ByteArrayContent(byteData)) { content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); response = await _httpClient.PostAsync(uri, content); } return(await GetResponseDocument(response)); }
public BookingServices(RequestRootObject root, ResRootObject res, string str) : base(root, res, str) { }
public RoomDisplayServices(RequestRootObject root, ResRootObject res, string str) : base(root, res, str) { }
public APIAIService(RequestRootObject root, ResRootObject res, string str) { this.root = root; this.res = res; this.str = str; }