HTTP OPTIONS error in Phil Sturgeon's Codeigniter Restserver and Backbone.js

前端 未结 2 2052
走了就别回头了
走了就别回头了 2020-11-28 11:51

My backbone.js application throwing an HTTP OPTIONS not found error when I try to save a model to my restful web service that\'s located on another host/URL.

2条回答
  •  广开言路
    2020-11-28 12:33

    You can also modify the $allowed_http_methods property in your subclass to exclude the options method. Previous versions of REST_controller did nothing with OPTIONS and adding this line seems to mimic that behavior:

    protected $allowed_http_methods = array('get', 'delete', 'post', 'put');
    

提交回复
热议问题