AngularJS $resource makes HTTP OPTIONS request instead of HTTP POST for $save method

后端 未结 2 1592
感情败类
感情败类 2020-12-25 12:57

I\'m in the process of writing a simple library application to get ready for a larger project with AngularJS. After reading a lot online about using $resource t

2条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-25 13:05

    I didn´t actually try this, but wouldn´t it be enough to tell the Ressource how to handle the $save request?

    $resource('http://mywebserver\\:1337/books/:bookId', { bookId: '@bookId' }, {save: {method: 'POST'});
    

提交回复
热议问题