Method
HttpResponseExtensions.WithContent<THttpResponse>
WithContent<THttpResponse>(THttpResponse, string) #
Sets the content of the HTTP response to a string.
public static THttpResponse WithContent<THttpResponse>(this THttpResponse response, string content) where THttpResponse : notnull, HttpResponseParameters #
response THttpResponse
content string
The string content to set.
Returns #
THttpResponse
The modified HTTP response.
Type Parameters #
THttpResponse
WithContent<THttpResponse>(THttpResponse, string, Encoding?, string) #
Sets the content of the HTTP response to a string with a specified encoding and MIME type.
public static THttpResponse WithContent<THttpResponse>(this THttpResponse response, string content, Encoding? encoding, string mimeType) where THttpResponse : notnull, HttpResponseParameters #
response THttpResponse
content string
The string content to set.
encoding Encoding?
The encoding to use for the content. Can be null.
mimeType string
The MIME type of the content.
Returns #
THttpResponse
The modified HTTP response.
Type Parameters #
THttpResponse
WithContent<THttpResponse>(THttpResponse, HttpContent) #
Sets the content of the HTTP response to a specified HttpContent.
public static THttpResponse WithContent<THttpResponse>(this THttpResponse response, HttpContent content) where THttpResponse : notnull, HttpResponseParameters #
response THttpResponse
content HttpContent
The HttpContent to set.
Returns #
THttpResponse
The modified HTTP response.
Type Parameters #
THttpResponse