What is content negotiation in Web API?

Updated Apr 28, 2026

Short answer

Content negotiation selects response format (JSON/XML).

Deep explanation

Based on Accept headers, Web API determines which format to return.

Real-world example

Returning JSON for web apps and XML for legacy systems.

Common mistakes

  • Ignoring client Accept headers.

Follow-up questions

  • What is Accept header?
  • Why negotiation?

More ASP.NET Web API interview questions

View all →