Explain Request Verbs Last Updated : 01 Nov, 2021 Summarize Comments Improve Suggest changes Share Like Article Like Report HTTP methods provide a way to specify the desired action to be performed on the given resource. The result depends upon the implementation of the server and it can be pre-existing data or data that is dynamically generated. The HTTP methods that are most commonly used are GET, POST, PUT, PATCH, and DELETE which correspond to CRUD (create, read, update, delete) operations. Request methods: GET: The GET method is used to retrieve information identified by Request-URL. It is the primary mode of information retrieval. It doesn’t change the state of the requested resource and is said to be a safe method. If the Request URL refers to a data-producing process, the produced data will be returned in response instead of the source text, unless the text is the output of a process. POST: The POST method is used to send data to the server as a request body. This method indicates that the data in the body of the request is intended to be accepted and most likely to be stored in the server. The Content-Type header indicates the type of the body of the request. It is mostly used while uploading a file or while submitting a complete web form. Responses to the method will not be cacheable until the response contains appropriate Cache-Control or Expires header fields. PUT: The PUT method is used to replace the already existing state of the resource or create the resource if the resource doesn’t exist (decided by the origin server) with the request payload. PATCH: The PATCH method is used to make a partial update to a resource. It can be considered as an instruction set that describes the modification of data already present on the server to produce a new version of the data and it is not considered as the complete resource. DELETE: The DELETE method is used to delete a specified resource on the origin server. The client cannot be assured that the operation was performed, even though the status code which is returned from the server indicates it. HEAD: The HEAD is identical to the GET request but the server must not send the response body but should send the same headers as it would have sent if URI was requested with the GET method. It can be used to get metadata without transferring the response body from the server and is often used for testing hypertext links for validity, accessibility, and recent modification. CONNECT: The CONNECT method is used to establish an end-to-end HTTP tunnel through a proxy server. OPTIONS: The OPTIONS method requests allowed communication options for a given resource. This request can be sent to find out the supported HTTP methods and other options that are supported without requesting the resource. TRACE: The TRACE method requests the server to send the exact request, as received by it, in the response body. It is useful for diagnostic purposes. A simple GET request in javascript: JavaScript // GET request fetch("https://jsonplaceholder.typicode.com/users/2") // Convert response to json .then((response) => response.json()) // Print data to console .then((data) => console.log(data)); Response Important terminologies: Safe: An HTTP method is safe if it doesn't change the state of the server. In other words, a method is safe if it can be used only for reading or retrieval of the data. Several HTTP methods are safe, for example, GET and HEAD. All safe methods are idempotent, but the converse is not true. For instance, the PUT and DELETE, both the methods are idempotent but are unsafe. Idempotent: An HTTP method is idempotent if the operation produces the same result when executed once or multiple times while leaving the server in the same state. In other words, an idempotent method should not cause any unintended effect regardless of the number of times it is executed. The GET, HEAD, PUT, and DELETE methods are idempotent if they are implemented correctly. All safe methods are also idempotent. Cacheable: A cacheable response is an HTTP response that can be cached, which is stored in order to access for later use, saving the new request to the server. This avoids unnecessary requests to the server.Request methodRequest has payloadResponse has payloadSafeIdempotentCacheableGET Optional Yes Yes Yes Yes POST Yes Yes No No Yes PUT Yes Yes No Yes No PATCH Yes Yes No No No DELETE Optional Yes No Yes No HEAD Optional No Yes Yes Yes CONNECT Optional Yes No No No OPTIONS Optional Yes Yes Yes No TRACE No Yes Yes Yes No Comment More infoAdvertise with us Next Article Explain Request Verbs N nk17oct Follow Improve Article Tags : Software Engineering Blogathon-2021 HTTP- response-status-codes HTTP Similar Reads Non-linear Components In electrical circuits, Non-linear Components are electronic devices that need an external power source to operate actively. Non-Linear Components are those that are changed with respect to the voltage and current. Elements that do not follow ohm's law are called Non-linear Components. Non-linear Co 11 min read Software Development Life Cycle (SDLC) Software development life cycle (SDLC) is a structured process that is used to design, develop, and test good-quality software. SDLC, or software development life cycle, is a methodology that defines the entire procedure of software development step-by-step. The goal of the SDLC life cycle model is 11 min read Spring Boot Tutorial Spring Boot is a Java framework that makes it easier to create and run Java applications. It simplifies the configuration and setup process, allowing developers to focus more on writing code for their applications. This Spring Boot Tutorial is a comprehensive guide that covers both basic and advance 10 min read Class Diagram | Unified Modeling Language (UML) A UML class diagram is a visual tool that represents the structure of a system by showing its classes, attributes, methods, and the relationships between them. It helps everyone involved in a projectâlike developers and designersâunderstand how the system is organized and how its components interact 12 min read Backpropagation in Neural Network Back Propagation is also known as "Backward Propagation of Errors" is a method used to train neural network . Its goal is to reduce the difference between the modelâs predicted output and the actual output by adjusting the weights and biases in the network.It works iteratively to adjust weights and 9 min read 3-Phase Inverter An inverter is a fundamental electrical device designed primarily for the conversion of direct current into alternating current . This versatile device , also known as a variable frequency drive , plays a vital role in a wide range of applications , including variable frequency drives and high power 13 min read Waterfall Model - Software Engineering The Waterfall Model is a Traditional Software Development Methodology. It was first introduced by Winston W. Royce in 1970. It is a linear and sequential approach to software development that consists of several phases. This classical waterfall model is simple and idealistic. It is important because 13 min read Polymorphism in Java Polymorphism in Java is one of the core concepts in object-oriented programming (OOP) that allows objects to behave differently based on their specific class type. The word polymorphism means having many forms, and it comes from the Greek words poly (many) and morph (forms), this means one entity ca 7 min read CTE in SQL In SQL, a Common Table Expression (CTE) is an essential tool for simplifying complex queries and making them more readable. By defining temporary result sets that can be referenced multiple times, a CTE in SQL allows developers to break down complicated logic into manageable parts. CTEs help with hi 6 min read What is Vacuum Circuit Breaker? A vacuum circuit breaker is a type of breaker that utilizes a vacuum as the medium to extinguish electrical arcs. Within this circuit breaker, there is a vacuum interrupter that houses the stationary and mobile contacts in a permanently sealed enclosure. When the contacts are separated in a high vac 13 min read Like