
1. GET
Purpose: Retrieve data from the server.
Example: GET /users/1 โ Fetch details of user with ID = 1.
Test focus: Ensure correct data is returned, no modification happens.
2. POST
Purpose: Create a new resource.
Example: POST /users with body { “name”: “Alice” } โ Creates a new user.
Test focus: Validate resource is created, new ID returned, proper status code (201 Created).
3. PUT
Purpose: Replace an existing resource entirely.
Example: PUT /users/1 with body { “name”: “Bob” } โ Replaces user 1 with new details.
Test focus: Verify old data is replaced, not partially updated.
4. PATCH
Purpose: Partially update an existing resource.
Example: PATCH /users/1 with body { “email”: “bob@test.com” } โ Updates only email for user 1.
Test focus: Confirm only specified fields are updated, others remain unchanged.
5. DELETE
Purpose: Remove a resource.
Example: DELETE /users/1 โ Deletes user with ID 1.
Test focus: Ensure resource is removed, subsequent GET should return 404 Not Found.
6. HEAD
Purpose: Similar to GET, but returns only headers (no body).
Example: HEAD /users/1 โ Check if user exists (without fetching full details).
Test focus: Validate metadata (status, content-length, etc.).
7. OPTIONS
Purpose: Show allowed HTTP methods for a resource (CORS checks).
Example: OPTIONS /users โ Server replies: Allow: GET, POST, PUT, DELETE.
Test focus: Ensure correct methods are exposed, CORS headers are set.
8. TRACE
Purpose: Diagnostic method that echoes the received request (used for debugging).
Example: TRACE /users โ Server returns request as received.
Test focus: Rarely used, but testers should check itโs disabled in production (security risk).
9. CONNECT
Purpose: Establish a tunnel to the server (used in HTTPS proxies).
Example: CONNECT www.example.com:443 โ Initiates TLS/SSL tunnel.
Test focus: Mostly at networking/proxy layer, ensure itโs handled securely.
โ Why API Testers Should Know All those Methods:
-To validate correct implementation of CRUD operations.
-To test security (some methods like TRACE & CONNECT should be blocked).
-To design complete test coverage (not just GET & POST).
-To ensure REST API follows standards and behaves consistently.
***
๐๐ณ๐๐๐๐ ๐ท๐๐๐๐๐๐-๐จ๐ท๐ฐ ๐ป๐๐๐๐๐๐ ๐๐๐๐ ๐น๐ฌ๐บ๐ป, ๐ฎ๐๐๐๐๐ธ๐ณ, ๐ถ๐จ๐๐๐ 2.0+๐ช๐ฐ ๐๐๐๐๐๐๐๐๐๐๐ (HIGHEST RATED ๐ผ๐ ๐๐๐-๐ท๐๐๐๐๐๐ ๐ช๐๐๐๐๐ ):๐ย https://www.udemy.com/course/sariful_postman/?couponCode=AUG2025
๐Master Cypress Automation-Scratch to Pro+ Frameworks & API:๐ https://www.udemy.com/course/master-cypress-automation-sariful/?referralCode=973061C2F57C6B3BB614
๐ Follow Sariful I. for more insights- QA & Automation, Mock Interviews & Career Growth content.
#apiTesting #postman #api #sdet #sqa