java - Error 405 Method Not Allowed error, when sending DELETE to server -



java - Error 405 Method Not Allowed error, when sending DELETE to server -

i next response when seek delete: 405 method not allowed. in logs there written allowed, delete isn't.

java:

@responsebody @requestmapping(method = requestmethod.delete, value = "/{id}") public void delete(@pathvariable string id) { speakerservice.delete(id); }

angularjs

app.factory('speakerresource', function ($resource) { homecoming $resource('rest/speaker/:speakerid', { speakerid: '@speakerid' }, { 'update': { method: 'put' } }, { 'delete': { method: 'delete', params: { 'id': 'speakerid' }} } ) });

speakerservice

this.delete = function (id, callback) { speakerresource.delete({ speakerid: id }, function () { callback(); }); }

i not know finish code, , not expert in angularjs, looks want send delete request url <hopefullysomething>/{id} (path variable). looks send delete request url parameter id <hopefullysomething>?id={id} (request parameter).

this question , answers explain difference between path variable , request parameters bit more @requestparam vs @pathvariable

java angularjs spring rest crud

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -