Interface IHttpResponseBuilder

Fluent builder for a single stub HTTP response (status, body, media type).

Namespace: BlazorToolkit.Previews
Assembly: BlazorToolkit.Previews.dll
Syntax
public interface IHttpResponseBuilder

Methods

WithContent(string, string)

Sets a body with an explicit media type.

Declaration
IHttpResponseBuilder WithContent(string content, string mediaType)
Parameters
Type Name Description
string content
string mediaType
Returns
Type Description
IHttpResponseBuilder

WithJson(string)

Sets a JSON body (media type application/json).

Declaration
IHttpResponseBuilder WithJson(string json)
Parameters
Type Name Description
string json
Returns
Type Description
IHttpResponseBuilder

WithStatus(int)

Sets the HTTP status code.

Declaration
IHttpResponseBuilder WithStatus(int statusCode)
Parameters
Type Name Description
int statusCode
Returns
Type Description
IHttpResponseBuilder