Get, post, power, and Net Load

Source: Internet
Author: User

Idempotence (idempotent and idempotence) is a mathematical or computer concept that is common in abstract algebra.

Idempotence has the following definitions:

1. for a single-object operation, if an operation is performed multiple times for all the numbers in the range, the result is the same as that obtained once, this operation is called idempotent. For example, an absolute value operation is an example. In a real number set, ABS (A) = ABS (a) is used )).

2. for binary operations, it is required that when the two values involved in the calculation are equivalent, if the calculation result is equal to the two values involved in the calculation, the operation is called the idempotence, for example, a function that calculates the maximum values of two numbers has the power in the real number set, that is, Max (x, x) = x.

Idempotence can be understood as the situation where multiple operations will produce equivalent results. Or operations at different times will not affect the results.

Idempotence and get and post

What is the difference between get and post, and when to use them.

Theoretically, if the request is idempotent, get can be used. The so-called idempotence means that multiple requests return the same result. In fact, the corresponding server method may modify the status in some way, so this is generally not true. This is just a standard. MoreThe actual difference is the size of the Net Load. In many cases, the browser and server limit the URL length to send data to the server.

Generally, get can be used to obtain data from the server. In other words,Do not use get to change the status on the server.

Generally, the POST method should be used when the status on the server is changed. Unlike get, you need to set the Content-Type header of the XML-httprequest object, as shown below:

XMLHTTP. setRequestHeader ("Content-Type", "application/X-WWW-form-urlencoded"); different from get,Post does not limit the size of the Net Load sent to the server, and the POST request cannot be idempotent.

Most of the requests you make may be GET requests. However, you can use post if necessary.

Payload)

A frame (Package) contains only the control information of the frame header and the end of the frame.

The net (negative) load is relative to the overhead. That is, we can recognize the amount of valid load data.

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.