EasyUI Forum
March 28, 2024, 02:59:00 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: switch all requests to POST  (Read 4573 times)
devnull
Sr. Member
****
Posts: 431


View Profile
« on: March 19, 2018, 02:57:09 AM »

Hi;

What is the easiest / best method to switch every control to use POST instead of GET ??

Thanks

Logged

-- Licensed User --
jarry
Administrator
Hero Member
*****
Posts: 2260


View Profile Email
« Reply #1 on: March 19, 2018, 03:25:10 PM »

The post is the default method for all the form components to post to remote server.
Logged
devnull
Sr. Member
****
Posts: 431


View Profile
« Reply #2 on: March 20, 2018, 07:06:28 AM »

Sorry, what I meant was how can I easily switch all objects between POST and GET method.

Thanks

Logged

-- Licensed User --
jarry
Administrator
Hero Member
*****
Posts: 2260


View Profile Email
« Reply #3 on: March 21, 2018, 02:52:57 AM »

This function changes the request method of all form components on the page.
Code:
function setRequestMethod(method){
    var plugins = $.parser.plugins;
    for(var i=0; i<plugins.length; i++){
        var name = plugins[i];
        $('.'+name+'-f').each(function(){
            var state = $(this).data(name);
            if (state && state.options && state.options.method){
                state.options.method = method;
            }
        });
    }
}
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!