示例#1
0
        public IActionResult RawMonthRecords([FromForm] RecordRequestDTO request)
        {
            string token = Request.Headers["Authorization"];

            if (token != $"Bearer {ClientKeys.password}")
            {
                return(BadRequest());
            }
            return(Ok(handler.ParseCommand(new SlashCommandDTO {
                text = Constants.rawDataCmd, user_id = request.UserID, team_id = request.TeamID
            })));
        }
示例#2
0
        public void Record_document_xpaths()
        {
            //Arrange
            //The two lines of code below can be replaced by your code which provides html content
            IManagedDriver driver = DriverPool.Instance.ActiveDriver.LaunchPage("https://www.google.com");
            string         html   = driver.Html;

            //Act
            RestClient  client  = new RestClient($"http://localhost:4476");
            RestRequest request = new RestRequest("/record", Method.POST);

            RecordRequestDTO requestDTO = new RecordRequestDTO
            {
                HtmlContent = html,
                Size        = 100
            };

            request.AddJsonBody(requestDTO);
            IRestResponse restResponse = client.Execute(request);
            string        content      = restResponse.Content;
            ResponseDTO   responseDTO  = JsonConvert.DeserializeObject <ResponseDTO>(content);
        }