API Testing

API testing verifies if APIs function correctly by checking requests, responses, and data validation.

Explanation:

  • Involves sending HTTP requests (GET, POST, PUT, DELETE).
  • Tools like Postman, JMeter, and REST-assured automate API testing.
  • Ensures security, performance, and reliability.

Example API Test (Python – requests)

import requests

response = requests.get("https://jsonplaceholder.typicode.com/posts/1")
print(response.json()) # Prints API response
  • This tests if an API endpoint correctly returns data.