The post method parameter sending method _ extjs

Source: Internet
Author: User
Generally, the parameters can be obtained after the url and the backend, but the send parameter can also be used as the sending parameter. This experiment shows that the server cannot receive the sent parameter, in firebug, we can see that the post part of the sent request is a string, which is not similar to the normally sent parameter. Ajax synchronous requests are generally as follows:

The Code is as follows:


Var conn = Ext. lib. Ajax. getConnectionObject (). conn;
Conn. open ("POST", 'HTTP: // localhost: 8080/struts2study/TreeDDGet? Node =-1 ', false );

// The conn object here is actually the xmlHttpRequest object.

Conn. setRequestHeader ("Content-Type", "application/x-www-form-urlencoded; charset = UTF-8 ");
Conn. send ("start =" + 0 + "& limit =" + 30 );
Var rootJson = conn. responseText;


Generally, the parameters can be obtained after the url and the backend, but the send parameter can also be used as the sending parameter. This experiment shows that the server cannot receive the sent parameter, in firebug, we can see that the post part of the sent request is a string, which is not similar to the normally sent parameter. After searching for a long time, I did not find a method. Later I found an article that introduced the sending method explanation of the xmlHttpRequest object, so that I knew that I needed to set the Content-Type attribute of the header to tell the server to send data in form mode, then the parameter strings in the send method will be interpreted by the server.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.