Tectu / malloy

A cross-platform C++20 library providing embeddable server & client components for HTTP and WebSocket.
BSD 3-Clause "New" or "Revised" License
66 stars 8 forks source link

Generator response types #123

Closed Tectu closed 1 year ago

Tectu commented 1 year ago

Currently, many of the functions implemented in malloy::http::generator return response<> which defaults to a string_body response. However, some of these could potentially be replaced with an empty_body instead.

Tectu commented 1 year ago

Upon inspection, any of the existing creators actually require a (string) body. Even redirects such as 303 should or may have a body as defined by RFC7231:

Except for responses to a HEAD request, the representation of a 303 response ought to contain a short hypertext note with a hyperlink to the same URI reference provided in the Location header field.