0

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.

1 Answers1

0

Just run your Project in localhost and copy the Url from the Browser and add your Api name , Example if the Project runs with an url like : https://localhost:3000/api/values

Just change the url with your api name in place of "values" https://localhost:3000/api/GetAllNotifications and now paste this url in postman and set get method and click on send make sure your project is running in the same localhost port Number.