API Terminologies Explained – HTTP, HTTPS, Methods, and Endpoints

๐ŸŒ 1️⃣ HTTP & HTTPS

๐Ÿ”ธ What is HTTP?

HTTP (HyperText Transfer Protocol) is the foundation of communication on the web.
It defines how data is requested and delivered between a client (like Postman or browser) and a server.

When you type a URL or send an API request:

  • The client sends an HTTP request.

  • The server processes it and returns a response (data, status code, headers).

๐Ÿงฉ Example:

RequestGET https://jsonplaceholder.typicode.com/posts/1 Response → 200 OK

๐Ÿ”ธ What is HTTPS?

HTTPS (HTTP Secure) is the secure version of HTTP, where communication between client and server is encrypted using SSL/TLS.
This ensures:

๐Ÿ’ก In short:
HTTP = plain communication
HTTPS = secure & encrypted communication


๐Ÿ“ฆ 2️⃣ Resource & Payload

๐Ÿ”น Resource

In an API, everything is treated as a resource — users, posts, products, or orders.
Each resource is identified by a unique URL (endpoint).

๐Ÿง  Example:

  • /users → represents a collection of users

  • /users/5 → represents a single user with ID = 5

So when you make a request:

GET https://dummyjson.com/users/5

You’re requesting the resource “User 5.”


๐Ÿ”น Payload

The payload is the data sent to the server in the body of an HTTP request — usually with POST or PUT methods.

๐Ÿงพ Example (POST request payload):

{ "name": "Hitendra", "email": "hitendra@test.com", "role": "admin" }

Here, this JSON object is the payload that the API receives and processes.

Tip:

  • GET requests don’t usually have payloads.

  • POST/PUT requests do.


๐Ÿงฎ 3️⃣ HTTP Methods

HTTP methods define what action you want to perform on a resource.
Here are the most common methods used in API testing ๐Ÿ‘‡

MethodDescriptionExample
GETRetrieve data from a serverGET /users
POSTSend new data to the server (create resource)POST /users
PUTUpdate an existing resourcePUT /users/3
PATCHPartially update a resourcePATCH /users/3
DELETERemove a resourceDELETE /users/3
HEADSame as GET but without body (for metadata)HEAD /users

๐Ÿ’ฌ Real-life analogy:

ActionExampleHTTP Method
View list of customers“Show me all users”GET
Add new customer“Register a new user”POST
Update user details“Change email of user 3”PUT/PATCH
Remove user“Delete user 3”DELETE

Sample HTTP post request:


๐Ÿ”— 4️⃣ URI, URL, URN, and Endpoint

These four terms often confuse beginners, so let’s simplify them ๐Ÿ‘‡

๐Ÿงฑ URI (Uniform Resource Identifier)

A URI is a general term for identifying a resource — it can be a name, location, or both.
It’s the umbrella term that covers both URL and URN.


๐ŸŒ URL (Uniform Resource Locator)

A URL tells you where a resource is located on the web.
It includes the protocol, domain, and path.

๐Ÿงพ Example:

https://api.github.com/users/hitendra

Here:

  • https → Protocol

  • api.github.com → Domain

  • /users/hitendra → Path to the resource

So this URL locates the user resource named “hitendra” in GitHub’s API.


๐Ÿงพ URN (Uniform Resource Name)

A URN identifies a resource by name, not by its location.
It doesn’t include protocol or domain.

Example:

urn:isbn:9780141033570

This refers to a book by its ISBN number — not where it is stored.


๐Ÿ“ Endpoint

An Endpoint is the specific URL where an API resource can be accessed.
It’s the address you hit when making API calls.

Example:

Base URL: https://dummyjson.com Endpoint: /products/10 Full URL: https://dummyjson.com/products/10

๐Ÿ“Š Visual Summary Diagram

[Client] → [HTTP/HTTPS Request] → [Server] ↘ Resource (e.g., /users/5) ↘ Payload (if POST/PUT) ↘ Endpoint = Base URL + Resource Path

URI, URL, URN, Endpoint




๐Ÿง  Quick Recap

✅ HTTP – defines communication protocol
✅ HTTPS – secure version of HTTP
✅ Resource – entity (user, post, etc.)
✅ Payload – data sent to server
✅ HTTP Methods – actions on resources
✅ URI = identifier
✅ URL = locator
✅ URN = name
✅ Endpoint = actual callable address

API Testing – What to Verify, Its Advantages & Difference from Web Services

๐Ÿš€ API Testing – What to Verify, Its Advantages & Difference from Web Services


๐Ÿงฉ What Exactly Needs to Be Verified in API Testing?


When performing API Testing, the goal isn’t just to check if an endpoint works — it’s to validate how reliably and efficiently the API behaves under various conditions.

Here are the key elements every tester should verify:

1️⃣ Response Status Codes

Each API response carries an HTTP status code that tells you if the request was successful or failed.
Examples:


2️⃣ Response Body Validation

Validate whether:

  • The data returned matches expected values.

  • Field names, data types, and structures align with the API specification.

  • No missing or extra fields are returned.

Example:
If the API should return:

{ "id": 101, "name": "John Doe", "email": "john@example.com" }

You must confirm all keys and data types (int, string, etc.) are accurate.


3️⃣ Response Time & Performance

APIs must respond quickly and consistently.
⏱️ Ideally, response times should be under 1–2 seconds for most business APIs.
You can measure this in Postman or automation frameworks like RestAssured.


4️⃣ Authentication & Authorization

APIs often use tokens or keys to ensure secure access.
Verify that:

  • Unauthorized requests are rejected.

  • Valid tokens grant correct access levels.

  • Session expiry or token invalidation works properly.


5️⃣ Error Handling

Good APIs fail gracefully.
Ensure error messages are:

  • Readable and consistent.

  • Contain useful information without exposing sensitive data.

Example:
❌ Avoid → "SQL Exception: syntax error near 'user_id'"
✅ Prefer → "Invalid input: user_id must be a number"


6️⃣ Schema & Contract Validation

Use schema validation tools to confirm the API structure remains consistent even after new releases — helping you catch breaking changes early.


๐Ÿ“Š API Verification Flow (Conceptual Diagram)

[Request Sent] ↓ [Server Receives Request] ↓ [Process Business Logic] ↓ [Generate Response → Validate: ✓ Status Code ✓ Response BodyHeaders ✓ Time ✓ Schema] ↓ [Return Response to Client]

Advantages of API Testing

API testing provides early and fast feedback before UI layers are even built.
Here’s why every QA professional should focus on API-level validation:

AdvantageDescription
1️⃣ Faster ExecutionNo GUI needed — APIs run directly at the service layer.
2️⃣ Early Bug DetectionYou can test logic before the UI exists, reducing rework.
3️⃣ Language IndependentAPIs exchange data in JSON/XML — any client can test them.
4️⃣ Reusable Test AutomationOnce automated, API tests can run in CI/CD pipelines easily.
5️⃣ Improved CoverageYou can test scenarios difficult to perform via UI.
6️⃣ Better StabilityAPIs rarely change compared to frontend elements, giving stable tests.

๐Ÿง  Tip: Combine API and UI testing to create a hybrid automation framework, ensuring both layers are verified for complete application coverage.


๐ŸŒ Difference Between API and Web Services

Many testers use “API” and “Web Service” interchangeably — but there’s a subtle difference.

FeatureAPIWeb Service
DefinitionInterface that allows communication between two software components.A specific type of API that operates over the web (HTTP, SOAP, REST).
Communication MediumCan use any protocol — HTTP, HTTPS, TCP, etc.Works only via the web using HTTP/HTTPS.
Data FormatCan exchange data in JSON, XML, or any format.Usually XML (SOAP) or JSON (RESTful).
DependencyCan exist without the internet (e.g., OS APIs, Library APIs).Requires internet/network to communicate.
ExampleJava SDK API, Database API, REST API.SOAP-based weather service, RESTful booking service.

In short:
๐Ÿ‘‰ Every Web Service is an API, but not every API is a Web Service.


๐Ÿ’ฌ Summary

✔ API testing verifies status codes, data, schema, performance, and security.
✔ It helps detect defects early, ensures data consistency, and supports faster releases.
✔ Understanding the difference between APIs and Web Services helps you design better testing strategies.

API Testing Introduction

 ๐Ÿงช What is API Testing?

API Testing is the process of verifying whether APIs work as expected — focusing on functionality, reliability, performance, and security.

Unlike UI testing, it doesn’t involve a browser or frontend.
Instead, you directly send requests (GET, POST, PUT, DELETE) and validate responses (status codes, response time, and data).

Key checks during API testing:

  • ✅ Is the response status code correct? (e.g., 200, 404, 401)

  • ✅ Is the response time within the limit?

  • ✅ Are all fields and data types correct?

  • ✅ Is authentication/authorization working properly?

  • ✅ Are error messages meaningful?


⚙️ How to Perform API Testing?

You can perform API Testing using manual tools or automation frameworks.

๐Ÿ”น Manual API Testing

Tools like Postman, Swagger, or Insomnia help testers send requests and analyze responses without writing code.

Basic flow:

  1. Launch Postman

  2. Create a new request

  3. Enter the API endpoint (URL)

  4. Select the method (GET/POST/PUT/DELETE)

  5. Add headers or authentication if needed

  6. Click Send

  7. Validate the response body, status code, and time

๐Ÿ”น Automated API Testing

Automation tools like:

These help run regression suites, integrate with CI/CD (Jenkins, GitHub Actions), and generate reports automatically.


๐Ÿ” Types of APIs

TypeDescriptionExample
Open APIs (Public APIs)Available to everyone; used by third parties.Google Maps, OpenWeather API
Internal APIs (Private APIs)Used only within an organization for internal systems.HRMS ↔ Payroll System
Partner APIsShared between specific business partners; require access tokens.Travel site ↔ Airline partner
Composite APIsCombine multiple endpoints in one call.Fetch order + shipping + payment info in one response

๐Ÿ“˜ Quick Recap

API = Communication Bridge between two systems
API Testing = Validating request & response
✅ Can be done manually (Postman) or automated (RestAssured, Python, etc.)
✅ Focus on status codes, response data, time, and security
✅ APIs can be Public, Private, Partner, or Composite


๐Ÿง  Pro Tip

Start practicing with free APIs like:
๐Ÿ”น https://reqres.in
๐Ÿ”น https://jsonplaceholder.typicode.com
๐Ÿ”น https://dummyjson.com
These are perfect for learning GET, POST, PUT, DELETE methods.