Hypertext Transfer Protocol (HTTP)

Learn about the Hypertext Transfer Protocol (HTTP) and its importance in APIs.

Introduction

The Hypertext Transfer Protocol (HTTP) is a statelessA stateless protocol is one in which each request is considered independent of any other request. This makes it simple to implement., application-layer protocol for distributed and hypermedia information systems. It's the foundation of data communication for the World Wide Web and is considered the de facto standard for client-server resource sharing. Web servers and client applications (browsers) must adhere to the message formats and transmission methods provided in the HTTP specifications. For instance, when we type a URL into a browser, the web server receives an HTTP request directing it to fetch and deliver the specified web page.

HTTP is based on the concepts of request and response, where one program (the client) requests another program (the server), and the server returns a response. The client usually makes requests in the form of HTTP commands, and the server responds with data in the form of documents. These commands are structured by different API architecture styles that we'll discuss in the coming chapters. Because it’s a driving force for APIs, HTTP is an essential protocol to understand.

As long as the request conforms to HTTP standards, the server will respond with the requested resources, regardless of the type of client.

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.