1

I'm working with CodeIgniter REST server by Phil Sturgeon found here and I am struggling to direct towards any other method other than GET. I have modified the code below:

function _ajaxEvent($element) {
    $.ajax({
            // URL from the link that was 'clicked' on

        url: $element.attr('href'),
        method: 'PUT'
        })
        .done(_ajaxDone)
        .fail(_ajaxFail);
}

and by theory this should be a PUT request and according to this particular implementation it should call a method similar to users_put, however neither am I able to call the users_put but the network monitor also displays as a GET.

I would really appreciate some advice on this. Looks like I've missed something.

Dale K
  • 25,246
  • 15
  • 42
  • 71
dev_tech
  • 47
  • 7
  • 2
    It is type not method, you should write type: 'PUT' – Mohd Alomar Jan 22 '21 at 22:08
  • 1
    This question has nothing to do with codeigniter or php. This question is how to make an ajax call. See duplicate question with answer here: https://stackoverflow.com/questions/8032938/jquery-ajax-put-with-parameters – Freddie Jan 22 '21 at 23:29
  • 1
    Does this answer your question? [jQuery Ajax PUT with parameters](https://stackoverflow.com/questions/8032938/jquery-ajax-put-with-parameters) – Freddie Jan 22 '21 at 23:30

0 Answers0