Reputation: 1043
I am having an API which returns the response in the format [{"Acc":"adm","Cnt":"087","Yr":"17"}].
var response_EndPoint = await client_EndPoint.GetAsync(EndPoint_URL);
var projectDetails = await response_EndPoint.Content.ReadAsAsync<Model[]>();
return Ok(projectDetails);
Now I am checking if there is a way to extend this Rest API to send two responses one is [{"Acc":"adm","Cnt":"087","Yr":"17"}] and the other is 17-adm-087
foreach (Model res in projectName)
{
string serviceResponse = string.Format("{0}-{1}-{2}", res.Yr,res.Acc, res.Cnt);
}
I am constructing the string but not sure if there is any possibility of sending both the responses.
Upvotes: 0
Views: 2454
Reputation: 5684
You cannot send two responses from one endpoint but you can merge the result into one response. If you need two totally different responses you have two options.
Upvotes: 3