Turn-talking about Http-get, http-post and soap

Source: Internet
Author: User
Tags html header http post

Original link: Talking about Http-get, http-post and soap

1, Http-get and Http-post

Http-get and Http-post are standard protocols that use HTTP (Hypertext Transfer Protocol) predicates ( predicates refer to the process of returning a true or false evaluation of a conditional expression. encodes the parameter Venus and passes the parameter as a name/value pair, and also uses the associated request semantics. Each protocol contains a series of HTTP request headers, HTTP request headers, and other information that defines what the client requests to the server, which server responds with a series of HTTP response headers and the requested data.

Http-get uses the MIME type application/x-www-form-urlencoded (which is appended to the URL of the server that handles the request) to pass its parameters as URL-encoded text. URL encoding is a form of character encoding that ensures that the passed arguments contain consistent text, such as encoding a space as%20, and other symbols to%xx, where XX is the ASCII (or ISO Latin-1) value that the symbol represents in 16 binary notation. The appended parameter is also known as a query string.

Similar to Http-get, the Http-post parameter is URL-encoded. However, the name/value pair is passed inside the actual HTTP request message, not as part of the URL.

the difference between 1.1Get and Post two points:Get mode: The URL string itself to pass data parameters, on the server side can be read from the ' query_string ' variable, high efficiency, but lack of security, also can not handle complex data. Post mode: In terms of the transmission mode parameters will be packaged in the packet transmission, read from the environment variable content_length, easy to transfer the larger data, and because the data is not exposed in the browser address bar, the security is relatively high, but such processing efficiency will be affected.   1.2 The difference between get and post methods in form submission is summarized as follows:1.get is querying/fetching data from the server, and post is transferring data to the server.

2. Get is the URL where the parameter data queue is added to the Action property of the submission form, and the value corresponds to the field one by one in the form, which is visible in the URL. Post is the HTTP post mechanism that places the fields within the form with their contents in the HTML header, along with the URL address referred to by the Action property. The user does not see the process.

3. For Get mode, the server side uses Request.QueryString to get the value of the variable, and for post, the server side uses Request.Form to obtain the submitted data.

4. Get transmits a small amount of data, cannot be greater than 2KB. Post transmits a large amount of data, which is generally not restricted by default. In theory, however, the maximum amount of IIS4 is 100KB in 80KB,IIS5.

5. Get security is very low, post security is high.

6. Get is the default method for form.

7. Generally static files do not allow the post action, if it is a dynamic language, such as ASPX files, usually allow post and get, you should be able to return the correct value

2. SOAP

Soap is a simple XML-based lightweight protocol that exchanges structured information and type information on the user's web. The overall design goal of SOAP is to make it as simple as possible and provide a minimum of functionality. The protocol defines a messaging framework that does not contain application or transport semantics. Therefore, the Protocol is modular and highly extensible.

By transmitting over a standard transport protocol, SOAP can use the existing open architecture of the Internet and is easily accepted by any system that can support the most basic Internet standards. The infrastructure necessary to support SOAP-compliant XML WEB services can be seen as a very simple and powerful infrastructure because it adds relatively little content to the existing infrastructure of the Internet, but it still helps to make common access to the services generated with soap.

The SOAP protocol specification consists of four main parts.

The first section defines the required extensible envelopes for encapsulating data. Soap envelopes define SOAP messages, which are the basic units of exchange between SOAP message handlers. This is the only required part of the specification.

The second part of the SOAP protocol specification defines the optional data encoding rules and a unified model, which are used to represent application-defined data and a forward graph, and the unified model is used to serialize the non-syntactic data model.

The third section defines the RPC style (Request/Response) message exchange pattern. Each SOAP message is a one-way transmission. Although the root of SOAP is in RPC, it is not limited to being a request/response mechanism. XML WEB services typically combine SOAP messages to implement such patterns, but the message exchange pattern is not required for soap, and this part of the specification is optional.

The fourth part of the specification defines the binding between SOAP and HTTP. However, this section is also optional. Soap can be used in conjunction with any transport protocol or mechanism that can transmit soap envelopes, including SMTP, FTP, and even floppy disks.

For the SOAP specification, see the Web site (http://www.w3.org/TR/soap).

2.1SOAP Instance SOAP Request:
Post/instock http/1.1
Host:www.example.org
Content-type:application/soap+xml; Charset=utf-8
content-length:nnn

<?xml version= "1.0"?>
<soap:envelope
xmlns:soap= "Http://www.w3.org/2001/12/soap-envelope"
soap:encodingstyle= "Http://www.w3.org/2001/12/soap-encoding" >

<soap:body xmlns:m= "Http://www.example.org/stock" >
<m:GetStockPrice>
<m:StockName>IBM</m:StockName>
</m:GetStockPrice>
</soap:Body>

</soap:Envelope>


SOAP Response:
http/1.1 OK
Content-type:application/soap+xml; Charset=utf-8
content-length:nnn

<?xml version= "1.0"?>
<soap:envelope
xmlns:soap= "Http://www.w3.org/2001/12/soap-envelope"
soap:encodingstyle= "Http://www.w3.org/2001/12/soap-encoding" >

<soap:body xmlns:m= "Http://www.example.org/stock" >
<m:GetStockPriceResponse>
<m:Price>34.5</m:Price>
</m:GetStockPriceResponse>
</soap:Body>

</soap:Envelope>

Turn-talking about Http-get, http-post and soap

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.