📁 Sangam Dhakal - Portfolio v2.0 - Netscape Navigator 4.0
_
□
×

📚 Interview question

When would you put a search behind POST /orders/search instead of GET with query parameters?

Intermediate Coding Intermediate

🎯 Key points

  • URL length limits (~8 KB in many servers and proxies)
  • Sensitive values leak into logs via query strings
  • POST loses caching and safe semantics
  • Keep it side-effect free and document it
  • Saved-search resource as an alternative

⏱ 30-second answer

When the filter is too complex or long for a URL (nested boolean logic, hundreds of ids), or contains sensitive values that shouldn't end up in access logs, browser history and proxies (names, dates of birth under the Privacy Act). The cost is losing HTTP caching and the safe/idempotent GET semantics, so document it as a read-only operation, keep it side-effect free, and consider a saved-search resource (POST creates it, GET reads results) if caching matters.

🔍 What the interviewer is checking

Checks understanding of URL length limits, caching, logging of sensitive values and safe-method semantics.

↩ Usually asked after

More in API Design

Last updated 23 Nov 2026.

🌐 Sangam's Webring

⏪ Previous 🏠 Main Next ⏩
💬 Chat with me