Header Ad Section

Introduction to HTTP & HTTP Methods


What is HTTP?

Hypertext Transfer Protocol (HTTP) is a Stateless Request-Response Protocol that is designed to enable communication between Clients and Servers.

Eg:- Client (Web Browser) sends an HTTP request to the server and then the Server returns a Response back to the Client (Web Browser).

Difference Between HTTP and HTTPS



According to the above images, the difference between HTTP and HTTPS is clearly shown. Basically, HTTP is an unsecured connection because it doesn't encrypt the data before sending through the network while HTTPS is a secured connection that encrypts the data before sending.

Basically, this "S" of HTTPS means the connection is secure. So the HTTPS stands for Hypertext Transfer Protocol Secure.

Another main difference is HTTP sends data over port 80 while HTTPS uses port 443.


Different HTTP Request Method Types

  1. GET
  2. POST
  3. PUT
  4. HEAD
  5. DELETE
  6. PATCH
  7. OPTIONS
  8. CONNECT
  9. TRACE
Let's have a quick discussion about the above-mentioned HTTP Request Method Types.

1. GET: - Generally GET method uses to request a representation of a specified resource from a remote service or backend endpoint. 

2. POST: - POST method is used to submit or send a specific set of data to a specific resource. But there could be consequences such as causing a change in the state or side effects in the server.

3. HEAD: - HEAD request is very similar to the GET request's behavior but, HEAD doesn't return data through the response body by providing facility to just request the server but without having a particular response.

4. PUT: - PUT uses to simply update or replace all current representations of the target resource with the request payload.

5. DELETE: - DELETE method uses to simply delete a specific resource by its unique value (id).

6. PATCH: - PATCH method is used to apply partial modifications to a specific resource. 

7. OPTIONS: - OPTIONS method is used to describe the communication options for the target resource.

8. CONNECT: - CONNECT method establishes a tunnel to the server identified by the target resource.

9. TRACE: - TRACE method performs a message loop-back test along the path to the resource.


Specifications Related to HTTP Requests




RFC 7231, section 4: Request methods were related to Hypertext Transfer Protocol (HTTP/ 1.1) and its Semantics and Content which specifies all the above methods except PATCH.
RFC 5789, section 2: Patch method was specially specified for PATCH method.

What Is RFC?

RFC simply stands for Requests for Comments. During the 1960s Information was transmitted from HOST to HOST in bundles called messages. A message is any stream of not more than 8080 bits. These were called "Requests for Comments"

These are some of the well-known RFCs.
  • 1974 TCP RFC 675 
  • 1977 TCP/IP IEN 2 
  • 1980 Telnet RFC 764 
  • 1980 FTP RFC 765 
  • 1982 SMTP RFC 821
  • 1988 RPC RFC 1050 
  • 1993 Gopher RFC 1436 
  • 1993 POP3 RFC 1460 
  • 1995 RPC, V2 RFC 1831 
  • 1996 HTTP/1.0 RFC 1945 

What is REST-API?

REST is a set of rules which defines how to use HTTP for different purposes. Generally, most of us use the same known HTTP protocol methods such as GET and POST without knowing their purpose, uniqueness, suitability or possible security issue may lead during the usage. So, REST defines the developers the way HTTP is used for the specific criteria.

Eg:- REST dictates the usage of DELETE to erase a document. But same as we may misuse a GET or POST method by appending a unique identifier behind the URL such as: ".../user/?delete_id=1"
 

Difference Between Get Request and Post Request



What is a URL?

Uniform Resource Locator(URL) is a reference to a web resource that specifies its location on a  computer network and a mechanism for retrieve that web resource. URL is a  combination of three different parts. They are;
  1. Protocol
  2. Domain Name/ Host Name
  3. Path of the Resource

What are URL Parameters

Other Names for URL Parameters are Query Strings and URL Variables. It is a part of a Uniform Resource Locator that assigns values to specified parameters. URL Parameters normally include fields added to the base URL by a Web Browser or other client application.




Post a Comment

0Comments