aeongt710 / dotnet-roadmap

0 stars 0 forks source link

Content Negotiation #19

Closed aeongt710 closed 9 months ago

aeongt710 commented 10 months ago

Content Negotiation

We are tasked with developing a server-side solution that ensures our web service dynamically adapts to the content negotiation requirements of incoming HTTP requests. The system must be capable of handling complex scenarios with the following specifications:

  1. Content Type Negotiation: The system must parse the Accept header from incoming requests to determine the client's preferred response format. For example:

    • If the client requests application/json, the response should be in JSON format.
    • If text/html or text/plain is requested, the response should be in simple HTML or plain text, respectively.
  2. AJAX Request Handling: It should detect whether the request is made via an AJAX call. The expected behavior in such cases is:

    • For AJAX requests, return a "partial view" suitable for updating the client's DOM without a full page reload.
    • For non-AJAX requests, return a "full view" which constitutes the entire HTML page.
  3. Graceful Fallback: In cases where the Accept header is not present, or the specified content type is unsupported, the system should default to a predefined content type, ensuring the client receives an appropriate response.

  4. Performance Considerations: The system should maintain performance efficiency, keeping the latency low and, where possible, leveraging caching mechanisms without compromising the dynamic nature of content negotiation.

Goals

Requirements

abdulislamian commented 10 months ago

https://github.com/abdulislamian/ContentNegotiation

CodingArc4 commented 10 months ago

https://github.com/CodingArc4/NegotiationTask

ShakeelAbbasKhan commented 10 months ago

https://github.com/ShakeelAbbasKhan/ContentNegotiation.git