dotnet-websharper / ui

A reactive UI library for WebSharper.
https://websharper-samples.github.io/ui/
Apache License 2.0
77 stars 22 forks source link

Add overloads with optional extra content headers and status code for `Content.Page*` #265

Closed granicz closed 1 year ago

granicz commented 1 year ago

This proposal adds the ability to specify an optional list of custom content headers (Content-Type:text/html; charset=utf-8 is assumed by default) and an optional status code to better support HTMX.

These need to be separate overloads, not changes on the original functions to avoid breaking existing code.

Content.Page : (Doc, ?Status:Http.Status, ?ExtraContentHeaders:seq<Http.Header>)
Content.PageFragment : (seq<Doc>, ?Status:Http.Status, ?ExtraContentHeaders:seq<Http.Header>)
granicz commented 1 year ago

This is now available after opening WebSharper.UI.Server.