Following fix for https://github.com/kalisio/krawler/issues/254, we should provide a way to define a default response body related to a HTTP code if required. Indeed, some codes (like 204) do not provide any content at all so that all hooks should deal with the different type of content based on some predicate, which is not convenient. For instance, for a JSON API any readJson hook, and further processing hooks, will have to deal with undefined content for a 204 response.
It would be better to define a default content for responses without a body so that hooks will not have to deal with the different type of content. For instance, in the JSON API use case, this content will be similar to an empty content returned with status 200.
Following fix for https://github.com/kalisio/krawler/issues/254, we should provide a way to define a default response body related to a HTTP code if required. Indeed, some codes (like
204
) do not provide any content at all so that all hooks should deal with the different type of content based on some predicate, which is not convenient. For instance, for a JSON API anyreadJson
hook, and further processing hooks, will have to deal withundefined
content for a204
response.It would be better to define a default content for responses without a body so that hooks will not have to deal with the different type of content. For instance, in the JSON API use case, this content will be similar to an empty content returned with status
200
.