0

Currently the setup I have includes two WebAPI endpoints (POST and DELETE) that are located within the same C# file:

[HttpPost]
[Route("api/authorizations/create/{id}")]
public IHttpActionResult CreateAuthorization(string id);

[HttpDelete]
[Route("api/authorizations/delete/{id}")]
public IHttpActionResult DeleteAuthorization(string id);

I can POST to the first endpoint successfully using Postman, but when I attempt to send a DELETE request to the second endpoint I get the following message

404 - File or directory not found.
The resource you are looking for might have been removed, had its name 
changed, or is temporarily unavailable.

Testing both of these endpoints locally worked just fine, but when I upload my project to a Staging environment I'm only able to access the POST endpoint.

Any idea why I can only access one? Again, these two endpoints are located within the same Controller file.

Delfino
  • 967
  • 4
  • 21
  • 46

1 Answers1

1

Check your runtime hosting environment. If it's something like IIS (or any other), DELETE verb mightn't be enabled.

Matías Fidemraizer
  • 63,804
  • 18
  • 124
  • 206