GET Request Exercises

Practice the following GET request scenarios.

Retrieve Resources

  • Fetch all users
  • Fetch a user by ID
  • Fetch paginated data
  • Fetch filtered data
  • Validate sorted results

Response Validation

  • Validate empty datasets
  • Validate unauthorized access

DummyJSON Practice

Practice using:

  • Query Parameters (limit, skip)
  • Path Parameters
  • Fetch products by category
  • Validate empty product responses

POST Request Exercises

Practice creating resources using POST requests.

Advertisement

Resource Creation

  • Create a new user
  • Create a new resource
  • Create nested resources

Business Validation

  • Validate duplicate resource creation
  • Validate mandatory field checks
  • Validate default field values

FakeStore Product Validation

Practice:


PUT & PATCH Request Exercises

Practice updating existing resources.


PUT Requests

  • Complete resource update
  • Validate idempotency
  • Validate updated data

PATCH Requests

  • Partial resource update
  • Validate unchanged fields
  • Validate updated values

FakeStore Product Update

Practice:

  • Update Product Price
  • Validate Updated Product Details

DELETE Request Exercises

Practice removing resources.


Delete Validation

  • Delete Resource
  • Validate Soft Delete
  • Validate Hard Delete

Deleted Resource Validation

Verify application behavior after deletion.

Examples include:

  • Deleted Product
  • Deleted User
  • Resource Not Found

HTTP Method Validation

Validate correct HTTP method implementation.


Validate Supported Methods

Verify that endpoints accept the correct HTTP methods.


Validate Unsupported Methods

Verify unsupported methods return:

 
405 – Method Not Allowed
 

Validate PUT Idempotency

Send the same PUT request multiple times and verify that the final resource state remains unchanged.


Validate Status Codes

Verify correct status codes for:

  • GET
  • POST
  • PUT
  • PATCH
  • DELETE

Request Data Handling

Practice different request payload creation techniques.


Dynamic Payload Generation

  • Generate dynamic payloads
  • Generate random test data

Nested JSON

Practice creating nested JSON request bodies.


JSON Arrays

Practice sending array-based payloads.


Optional Fields

Validate optional request fields.


Large Payloads

Practice sending large request payloads.


Invalid Content Type

Validate behavior when incorrect Content-Type values are supplied.


Invalid Payload

Send invalid request bodies and validate responses.


Special Characters

Validate payloads containing special characters.


Payload Schema Validation

Validate request payload structure.


Payload Management

Maintain:

  • Reusable Payload Files
  • Payload Versioning

Payload Creation Techniques

Create request payloads using:

  • HashMap
  • POJO Classes
  • JSON Files
  • String Payload

Support:

  • Dynamic Payload Generation
  • Reusable Payload Utilities

Demo API Mapping

Practice the exercises using public APIs.


HTTP Methods

Recommended API

  • ReqRes

Practice:

  • GET
  • POST
  • PUT
  • PATCH
  • DELETE
  • HTTP 405 Validation
  • PUT Idempotency

Request Data

Recommended API

  • DummyJSON

Practice:

  • Query Parameters
  • Path Parameters
  • Nested JSON
  • Large Payloads
  • Content-Type Validation
  • Special Characters

Product CRUD

Recommended API

  • FakeStore API

Practice:

  • Get All Products
  • Get Product by ID
  • Get Products by Category
  • Pagination
  • Create Product
  • Update Product
  • Delete Product
  • Validate Deleted Resource

Frequently Asked Questions

Which CRUD operations should be practiced?

Practice the complete CRUD lifecycle.

GET

  • List Resources
  • Resource by ID
  • Pagination
  • Filtering
  • Sorting

POST

  • Resource Creation
  • Nested Objects
  • Duplicate Validation
  • Mandatory Fields

PUT & PATCH

  • Full Update
  • Partial Update
  • Idempotency Validation

DELETE

  • Soft Delete
  • Hard Delete
  • Deleted Resource Validation

How do you validate PUT idempotency?

Execute the same PUT request multiple times and verify that the final resource state remains identical after every execution.


What response should an unsupported HTTP method return?

The expected response is:

 
405 – Method Not Allowed
 

Which techniques can be used to create request payloads?

The supported payload creation techniques include:

  • HashMap
  • POJO Classes
  • JSON Files
  • String Payload

These techniques can also support dynamic payload generation and reusable payload utilities.


Which request data scenarios should be validated?

Important request data scenarios include:

  • Nested JSON
  • JSON Arrays
  • Optional Fields
  • Large Payloads
  • Invalid Content Type
  • Invalid Payload
  • Special Characters
  • Payload Schema Validation