0

Unable to call HttpPut and HttpDelete method from POSTMan Client to ASP.NET WebAPI below is the code along with web.config entry . I am running the WEBAPI on my local IIS. The HttpPost and HttpGet methods work.

enter image description here

On running the code from POSTMan client throws 404 error. enter image description here

enter image description here

Web.Config values enter image description here

enter image description here

1 Answer 1

1

The way you are calling your PUT method is wrong.

Change the prototype of your method to:

[HttpPut]
[Route("update/{cKey}"]
public HttpResponseMessage Put(int cKey)

After that, your call in Postman should work.

The way you defined your route is not correct because the cKey variable never gets mapped. Since your method accepts a not nullable integer, you must supply it in your query string. So a request to update?valQuestionPayload=123 will also work.

Sign up to request clarification or add additional context in comments.

1 Comment

it is unchecked and does not work still unable to call the put methods

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.