Open MichaelXavier opened 5 years ago
@phadej Thoughts?
I think #969 will solve some issues:
Content-Type
, when serving NoContentAccept: */*
when no content is expected to be returnedFor now, I'd try if we can have an OVERLAPPING
instance for Verb ... NoContent
, which won't perform accept-check. I was pretty sure we had it already.
If I'm understanding correctly, it seems that if you're creating an endpoint that does not take a body, NoContent would be an appropricate content type to use since you can't use an empty list. However, NoContent does not have any sensible
Accept
instance, nor a reasonableMimeUnrender
. For MimeUnrender, it seems clear that an instance for()
which always succeeds would be appropriate. However, forAccept
, there is isn't really a nullary mime type to indicate nothing. The specs seem to indicate that Accept is optional but that clients should assume the endpoint accepts bothtext/plain
andtext/html
.So the question:
instance MimeUnrender NoContent ()
?Accept
not require a specific mime type since it isn't required. The pragmatic approach that would disturb less code would seem to be to accepttext/plain
andtext/html
forNoContent
as per the spec's rules about defaulting, possibly at the cost of producing a confusingAccept
.