Method WithContent
WithContent<THttpResponse>(THttpResponse, string)
Sets an UTF-8 string as the HTTP response content in this HttpResponse.
public static THttpResponse WithContent<THttpResponse>(this THttpResponse response, string content) where THttpResponse : HttpResponse
Parameters
response
THttpResponseThe HttpResponse object.
content
stringThe UTF-8 string containing the response body.
Returns
- THttpResponse
The self
THttpResponse
object.
Type Parameters
THttpResponse
The type which implements HttpResponse.
WithContent<THttpResponse>(THttpResponse, string, Encoding?, string)
Sets an string as the HTTP response content in this HttpResponse.
public static THttpResponse WithContent<THttpResponse>(this THttpResponse response, string content, Encoding? encoding, string mimeType) where THttpResponse : HttpResponse
Parameters
response
THttpResponseThe HttpResponse object.
content
stringThe string containing the response body.
encoding
EncodingThe encoding to encode the string message.
mimeType
stringThe mime-type of the response content.
Returns
- THttpResponse
The self
THttpResponse
object.
Type Parameters
THttpResponse
The type which implements HttpResponse.
WithContent<THttpResponse>(THttpResponse, HttpContent)
Sets an HttpContent as the HTTP content body in this HttpResponse.
public static THttpResponse WithContent<THttpResponse>(this THttpResponse response, HttpContent content) where THttpResponse : HttpResponse
Parameters
response
THttpResponseThe HttpResponse object.
content
HttpContentThe HTTP content object.
Returns
- THttpResponse
The self
THttpResponse
object.
Type Parameters
THttpResponse
The type which implements HttpResponse.