Skip to content

2.8.0.0

Choose a tag to compare

@github-actions github-actions released this 02 Apr 14:40

Add support to supply a lambda to create the response that's sent to the client. It allows you to generate a more dynamic response if the path you're configuring requires that.

For example:

handler
.RespondTo(HttpMethod.Get, "/api/entity/blah")
.With(HttpStatusCode.OK)
.AndContent(
"application/json",
req => $@"{{""path"":""{req.RequestUri!.PathAndQuery}""}}");

When calling that endpoint the response will contain the path taken from the request.