Can Media Types be used to select between different "views" of the same data? RRS feed

  • Question

  • User267848334 posted

    In our asp.net webapi's we use a querystring parameter "returnType" (full or compact) that determines the size of the object that is returned. For instance a "full" employee object contains all the fields, the "compact" type contains a subset. Consumers of the api choose the returnType mainly to safe bandwidth and memory and improve the response times.

    Are Media Types a correct way to implement this behaviour in asp.net core?

    [Edit] By this I mean vendor types like "application/vnd.mycompany.employee.full+json" and "application/vnd.mycompany.employee.compact+json"

    Or is there another preferred approach to tackle this problem?

    Thursday, August 3, 2017 10:49 AM

All replies