public IActionResult Post([FromBody] string payload) { ServicesUtility utility = new ServicesUtility(_configuration); try { utility.RelayMessage(payload, false, Request.Headers); } catch (Exception ex) { return(new ObjectResult("Could not relay message to target: " + ex.Message)); } return(new OkObjectResult("Relayed message successfully.")); }
public IActionResult Get() { var target = _configuration.GetSection("Target")["Location"]; ServicesUtility utility = new ServicesUtility(_configuration); try { var res = utility.RelayMessage("{\"test\":\"true\"}", true, Request.Headers); } catch (Exception ex) { return(new ObjectResult("Could not send test message to target: " + ex.Message)); } return(new OkObjectResult("Sent test message successfully.")); }