Getting 404 before getting to handler - The resource you are looking for has been removed, had its name changed, or is temporarily unavailable

I recently added a new DTO, looks a lot like my other DTOs.

[Route("/api/DeleteProducts", "PUT")]
public class DeleteProducts
{
	public IEnumerable<string> SkuList { get; set; }
}

I have a custom RawHttpHandler… starts like this:

this.RawHttpHandlers.Add(httpReq =>
			{

				Util.ServiceLog.Info(httpReq.Verb + "-" + httpReq.PathInfo);

All the other API calls work fine, and all api and other static file requests log their request but for some reason calling

  $http.put('/api/DeleteProducts',list).then(function (response) {...

Gets a 404 and does not even make it to the RawHttpHandlers. The response body is “The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.”

Confusing, would love some help.

Full headers

I

It’s the first time I’ve seen a PUT used for a DELETE Request. You should either use the DELETE or POST Verb.

Don’t use interfaces in DTOs like IEnumerable, use a concrete List<string> or string[].

That request doesn’t look like it’s reaching ServiceStack for whatever reason, I’m assuming you have a conflict somewhere, do you have a folder called /api? or have you configured ServiceStack to run on /api? If you have you shouldn’t prefix your route with /api.

Thanks for all the feedback, as I mentioned… other calls to similar DTOs are working just fine… all are prefix with api, for a reason.

As an aside I don’t believe DELETE supports a payload so inefficient on large batch requests, and I’m not religious about verb mapping, its just another piece of information.

There looks like there’s a conflict preventing the request from reaching ServiceStack, I can’t see your configuration so I’m guessing for different things to check. If you have WebDav enabled, you can try removing the WebDav module.

For DELETE requests you can populate params via QueryString, e.g:

/api/DeleteProducts?SkuList=sku1,sku2,sku3

But otherwise you can use POST.

Thanks for the tip, Webdav disable did not work but it is something with the IIS implementation re: PUT, I changed to POST and its working fine. Thanks again.

I do have: