public IActionResult SaveCartURL([FromBody] LiveCaption liveCaption) { try { if (!string.IsNullOrEmpty(liveCaption.CartUrl.Trim()) && liveCaption.CartUrl.Contains("meetingid") && liveCaption.CartUrl.Contains("token")) { MeetingCartUrl = liveCaption.CartUrl; return(this.Ok()); } else { return(this.BadRequest()); } } catch (Exception ex) { Console.WriteLine(ex.Message); return(this.BadRequest()); } }
public async Task <IActionResult> LiveCaptionAsync([FromBody] LiveCaption liveCaption) { try { var data = new StringContent(liveCaption.CaptionText, Encoding.UTF8, "text/plain"); var httpClient = new HttpClient(); var response = await httpClient.PostAsync(MeetingCartUrl, data); if (response.StatusCode == System.Net.HttpStatusCode.OK) { return(this.Ok()); } else { return(this.BadRequest()); } } catch (Exception ex) { Console.WriteLine(ex.Message); return(this.BadRequest()); } }