Difference between Get request and Post request: getpost request

Source: Internet
Author: User

Difference between Get request and Post request: getpost request

During the course of being a cloud platform for colleges and universities, I believe everyone has encountered the value transfer problem. It is estimated that everyone is comfortable with the Get and Post request methods. It is used, but the difference is true. However, if we do not summarize the difference, we will analyze it today.

There are two methods to provide server requests: Get and Post.

Get requests are the most common types of requests. It is most commonly used to query certain information from the server. If necessary, you can append the query string parameter to the end of the URL to submit it to the server. The question mark after the URL is used to pass data to the server key-value pair, and the server receives the response data.

A Post request can contain a lot of data. When using a form, many of them use the Post transmission method.

From a macro perspective, the two data requests are as follows:


The differences between the two are as follows:


Such examples are also common during project creation:

Post request:

<Span style = "font-family: KaiTi_GB2312; font-size: 18px;"> // submit the Query Form $ ('# AddExam '). form ({url: "/Exam/AddExam", onSubmit: function (sub) {// perform form Verification // if false is returned to prevent submission // if (document. examName = "") // alert (the exam name cannot be blank); return false ;}, // success: function (data) {success: $. messager. alert ("prompt", "Exam added successfully! "," Info ", function (data) {// return; // $. messager. show ({// title: "Operation prompt", // msg: "added successfully! "//}) // Alert (" added exam! "); $ ('# Dg '). datagrid ('reload'); // document. getElementById ("dlaag "). innerHTML = data; $ ('# dlaag '). dialog ('close'); // $ ('# datagrid-view '). datagrid ('reload'); $ ('# win '). window ('open'); // $ ('# bindExaminee '). dialog ('open '). dialog ('settitle', 'Bind examinee '); $ (' # dlg '). form ('clear') ;})}); </span>
Get request:

<span style="font-family:KaiTi_GB2312;font-size:18px;">$(function() {    $("#College").combobox({        valueField:'OrganizationID',        textField:'OrganizationName',        method:'get',       url:'/Exam/QueryAllCollege',        onSelect: function (rec) {     @*  var url1 = '/Exam/QueryCourseByCollege?OrganizationID=' + rec.OrganizationID;     //      $('#CourseId').combobox('reload', url1);*@             $.get('/Exam/QueryCourseByCollege', { OrganizationID: rec.OrganizationID }, function (data) {                $('#CourseId').combobox('clear').combobox('loadData',data);           },'json');        }    });   $("#CourseId").combobox({        valueField: 'CourseID',        textField:'CourseName'   });});</span>
We will continue to meet these two request methods in the future and deepen our understanding. But what I want to say is that in B \ S learning, we also learned, but it still won't be used in project development.

The theory and practice are the final principles, and we will never know how to do this. The conclusion is that we can better knit knowledge networks, so these three are indispensable.


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.