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.
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.