public IHttpActionResult AllResponses([FromBody] SearchRequest searchRequest) { if (searchRequest == null) { return(BadRequest("Invalid passed data")); } if (string.IsNullOrEmpty(searchRequest.api_key)) { return(BadRequest("Please pass api key")); } if (searchRequest.queries == null || searchRequest.queries.Count == 0) { return(BadRequest("Invalid passed data")); } if (!ModelState.IsValid) { return(BadRequest(ModelState)); } TradeGovService tds = new TradeGovService(); var responses = tds.GetTradeGovResponses(searchRequest); return(Ok(responses)); }
public IHttpActionResult GetResponse() { NameValueCollection ncv = HttpUtility.ParseQueryString(Request.RequestUri.Query); TradeGovService tds = new TradeGovService(); var _response = tds.GetTradeGovResponse(ncv); return(Ok(_response)); }