I am trying to call the following Web API method in Postman:
public HttpResponseMessage GetAllNotifications(HttpRequestMessage request, String Name)
{
HttpResponseMessage response = null;
try
{
List<ExpandoObject> res = _userProcess.GetAllNotifications(Name);
response = request.CreateResponse<List<ExpandoObject>>(HttpStatusCode.OK, res);
}
catch (Exception ex)
{
response = request.CreateResponse<string>(HttpStatusCode.BadRequest, "Unable to process your request Please contact administration");
throw new DataException(ex.Message.ToString());
}
return response;
}
Any advice appreciated.