Getting Started with Java: HTTP basics

Source: Internet
Author: User

The vast majority of web development is based on this, HTTP is a Hypertext Transfer protocol. is the protocol at the application level .

HTTP is a stateless protocol based on the request/response pattern.

TCP connections are optimized in Http1.1, and multiple requests can be processed within a single connection.

The HTTP request is divided into three parts: 1. Request Line 2. message Header 3. Request body sent by the viewer to the server

I. Introduction:

The request line begins with a method, followed by the version of the request URI and protocol.

Several ways to request http: Get and POST and head

Get: Request for the resource identified by Request--uri;

Post: Append new data after the data identified by Request--uri

HEAD: A header that requests the response of the resource identified by the Request--uri;

When we go to the Web page by entering the URL directly through the browser's address bar, the browser uses the Get method to get the resources like the server;

The Post method is used to send a request to the server, requiring the server to receive the data after the request, and the Post method is used at most when the table is submitted; username=hello&world;

The head method is almost the same as the Get method, except that the head method simply requests the message header;

Two. Description of the http-status code

--1XX: Indicates that the request has been received and continues processing;

--2XX: Success indicates that the request has been received, processed, understood;

--3XX: Redirect to complete the request must be further done

--4XX: Client error, request syntax error or request not implemented

--5XX: Server-side error, the server failed to implement a legitimate request;

Getting Started with Java: HTTP basics

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.