Quantcast
Channel: Web API
Viewing all articles
Browse latest Browse all 4850

PUT method not supported

$
0
0

I am trying to test my Rest Web API through postman. I got the error 

 "Message": "The requested resource does not support http method 'PUT'."

[HttpPatch]
        [HttpPut]
        public HttpResponseMessage PUT(int id,Contact contact)
        {
            contact.ID = id;
            if(!contactRepository.Update(contact))
            {
                throw new HttpResponseException(HttpStatusCode.NotFound);
            }

            return Request.CreateResponse(HttpStatusCode.OK);
        }

I have define Put method in my controller. Why am I getting this error?

"Message": "The requested resource does not support http method 'PUT'."


Viewing all articles
Browse latest Browse all 4850

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>