4 ms·
XML, JSON, Protobuf can all be used as object serialization formats. It's not nonsensical at all for an endpoint to offer choice as to what serialization format
by naasking 3y ago
XML, JSON, Protobuf can all be used as object serialization formats. It's not nonsensical at all for an endpoint to offer choice as to what serialization format a client may want to use. It's not common, but that doesn't mean nonsensical.
- Gigachad 3y agoThe client can request the URL that gets the type of response it wants. There is no advantage of using the accept header.
- naasking 3y agoURLs are much longer, harder to remember and harder to communicate than accept header values. It also unnecessarily complicates the API. It also relies on out-of-band/non-standardized information to know which URL returns which format, where the accept headers is in-band/standardize information for specifying the return format. Seems like there are more multiple advantages.