Loading...
Loading...
HTTP (HyperText Transfer Protocol) is data transfer protocol used for exchanging information between client (e.g., web browser) and server over Internet. HTTP is foundation of World Wide Web and is used for requesting and transferring data such as HTML pages, images, videos and other resources.
HTTP works on client-server principle. When user enters URL in browser or clicks link, browser sends HTTP request to server, which processes request and sends back HTTP response with requested data.
HTTP workflow looks like this:
HTTP request consists of several parts.
HTTP Method: Method determines what action server should perform with requested resource. Most common HTTP methods:
URL (Uniform Resource Locator): This is address of resource being requested. Includes protocol (e.g., http://), domain, path and query parameters.
HTTP Version: Indicates HTTP protocol version used by client for request. In most cases HTTP/1.1 or HTTP/2 version is used.
Request Headers: Headers contain metadata about request. These can be data about content type, language, cookies, authorization and other parameters that may be useful for server to process request.
Header examples:
Content-Type — content type (e.g., text/html, application/json).User-Agent — information about client browser or device.Authorization — authentication data.Accept — indicates which data types client is ready to accept from server.Request Body: Request body is used in methods such as POST, PUT or PATCH to send data to server. Body can contain information such as forms or JSON data.