简体   繁体   中英

Azure Mobile Services Patch and Delete Returning 404 Not Found

I have an Azure Mobile Service connected to an existing database. On testing it, the GET, GET (id) and POST are working properly but PATCH and DELETE are returning an error 404 Not Found with the below

"message":"No HTTP resource was found that matches the request URI'"

I see that the breakpoint is hit properly which I assume that issue is not with the routing.

I use a CustomMappedEntityDomainManager in which I have the below code for PATCH and DELETE

    public async Task<RegisteredUsersDto> PatchRegisteredUsers(string id, Delta<RegisteredUsersDto> patch)
    {
         return await UpdateAsync(id, patch);
    }

    public Task DeleteRegisteredUsers(string id)
    {
         return DeleteAsync(id);
    }

Any quick pointers will be appreciated.

It's hard to say with just this information, but it sounds like your mapped domain manager is does not have the right routes set up. Here's a working sample that shows a mapped domain manager in action: https://github.com/paulbatum/FieldEngineerLite/blob/master/FieldEngineerLite.Service/Controllers/JobController.cs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM