Headers, Query & Path Parameters

Part 4 — the metadata and inputs that shape a request.

By SixQuality · API Testing

Beyond the method and URL, requests carry extra information through headers and parameters. Knowing the difference is essential for building and testing requests correctly.

Headers

Headers are metadata sent with the request or response. Common ones include:

Path vs query parameters

Path parameters

Identify a specific resource, built into the URL path.

  • /users/42 — user with id 42.
  • Required; part of the address.

Query parameters

Filter, sort, or paginate, added after a ?.

  • /users?role=admin&page=2
  • Usually optional; refine the request.
Test idea: check that path parameters correctly select resources (including invalid ids returning 404), and that query parameters filter and paginate as documented.

Conclusion

Headers carry metadata like content type and authentication, while path and query parameters target and refine the resource you are requesting. Handling each correctly — and testing them — is key to reliable API calls.

← Previous: 3. HTTP Status Codes Explained Next: 5. Working with JSON Request & Response →