zhangjun
zhangjun

Reputation: 51

laravel ajax method:'post' but It send http request with get

use ajax for laravel 4.x , code

 $('#button').click(function(e){  
        $.ajax({   
           method:'post',  
           url:'test',
           data:datas,//exists
           success:function(data){  
           }, 
        }); 
    });

but i found it send http request with get,

Upvotes: 0

Views: 282

Answers (1)

user3702775
user3702775

Reputation: 271

Try this -

$('#button').click(function(e){  
        $.ajax({   
           type:'post',  
           url:'test',
           data:datas,//exists
           success:function(data){  
           }, 
        }); 
    });

(Note that method is replaced by type)

Upvotes: 1

Related Questions