QT Insights: The difference between post and get (get combines parameters directly with the URL as a whole, while post splits it into two parts)

Source: Internet
Author: User

The first Contact QT HTTP project, today looked at the post and get basic use method, began to try. Originally thought that post is dedicated to sending requests to the server, and then receiving the server answer, and get is simply to get the resources from the server, such as downloading this page, to obtain the resources stored on the Web page. But when it comes to projects, the results of the tests are a testament to my innocence and misunderstanding.

In fact, both post and get are used to send requests to the server, both of which can take parameters, but in a slightly different way. The difference is that get integrates parameters directly with the URL as a whole, while post splits it into two parts, one part is the URL, the other is the parameter, and the message SetHeader must be set, otherwise the server cannot find the parameter. The so-called acquisition of resources or the receiving server answer, is not implemented by them, but by the qnetworkrequest to Qnetworkaccessmanager send a request, The answer is received by qnetworkreply from Qnetworkaccessmanager, and finally by Qnetworkaccessmanager interacting with the server.   It can be said that post and get are two kinds of request, their operation will trigger the qnetworkaccessmanager/qnetworkrequest/qnetworkreply of the formation of the HTTP network mechanism, or the method depends on the mechanism. PS: The above comments are purely personal opinions, if there are errors, please leave a message. For a detailed distinction between get and Post, refer to Csdn's article: http://blog.csdn.net/lslxdx/article/details/7485297

The article is somewhat old, uses is already has been eliminated by the Qt5 Qhttp class, but still has the very big reference significance, is worth a look. http://blog.csdn.net/jan5_reyn/article/details/38955715

QT Insights: The difference between post and get (get combines parameters directly with the URL as a whole, while post splits it into two parts)

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.