Originally posted by @g105b in #720
The router of WebEngine currently defaults to page requests unless specified with an Accept header, but I'm trying to enhance the usability of the default behaviour when prototyping APIs with curl.
Currently, we have this default config:
[router]
default_content_type=text/html
but I'd like to extend this into two default states: default_content_type, and no_match_content_type.
no_match_content_type would be used if there was no match, or if there was not an Accept header sent.
default_content_type would be used if there was a loose match, and a default needed picking. Because there could be more ambiguity with this, default_content_type should be able to be a comma/semicolon separated list of content types, where the best match would be used, according to the provided accept header. For example: text/* could match text/plain and text/html. If you care about the difference, you should be able to specify it here.
Originally posted by @g105b in #720
The router of WebEngine currently defaults to page requests unless specified with an
Acceptheader, but I'm trying to enhance the usability of the default behaviour when prototyping APIs with curl.Currently, we have this default config:
but I'd like to extend this into two default states:
default_content_type, andno_match_content_type.no_match_content_typewould be used if there was no match, or if there was not an Accept header sent.default_content_typewould be used if there was a loose match, and a default needed picking. Because there could be more ambiguity with this, default_content_type should be able to be a comma/semicolon separated list of content types, where the best match would be used, according to the providedacceptheader. For example:text/*could matchtext/plainandtext/html. If you care about the difference, you should be able to specify it here.