Enjoying this guide? Join our developer community!
Subscribe to Ram N Java on YouTubeComplete Guide to HTTP Methods: GET, POST, PUT, DELETE, and More
In web development and REST APIs, HTTP Methods (often called HTTP verbs) indicate the desired action to be performed on a given resource. HTTP method names are case-sensitive and must always be written in UPPERCASE. Let’s break down all 8 primary HTTP methods and how they function between client and server.
1. The Primary Data Methods
GET: Used strictly to request and retrieve data from a specified resource. It reads server data without modifying it and displays the response in the client browser.
POST: Used to submit data from the client to the server (e.g., submitting contact forms, uploading files, or creating new database records).
PUT: Used to send data to update an existing resource on the server. If the target resource does not exist, PUT can also create it.
DELETE: Instructs the server to remove or delete the specified target resource permanently.
2. Utility and Inspection Methods
HEAD: Similar to a GET request, but it returns only the status line and header metadata—omitting the response body entirely. This is ideal for checking resource existence or headers without downloading heavy payloads.
OPTIONS: Queries the server to find out which HTTP methods and communication options are supported by the target resource URL.
CONNECT: Establishes a transparent bidirectional network tunnel between the client and the destination server, typically used for SSL/TLS encrypted connections through proxies.
TRACE: Performs a message loop-back test along the path to the target resource. The server echoes the received request back to the client, making it useful for network debugging and testing.
Quick Rule to Remember:
Always write HTTP methods in capital letters: GET, POST, PUT, DELETE, HEAD, OPTIONS, CONNECT, TRACE.
Recommended Related Tutorials from Ram N Java
Click here to watch in Youtube : https://www.youtube.com/watch?v=PO7D20HsFsY
Click the below Image to Enlarge
1.POST
2.PUT
3.GET
4.DELETE
5.HEAD
6.CONNECT
7.OPTIONS
8.TRACE
No comments:
Post a Comment